• Resolved ckwolfling

    (@ckwolfling)


    I am using a child of the motif theme and I am having a problem on the no-results page. On every other page the footer is inside the main #page (or .hfeed .site) div, but on the no-results page it falls outside this div.

    The main site with the correct footer can be found here
    while the problem can be seen here

    Any help would be appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Kathryn Presner

    (@zoonini)

    I installed Motif on a test site with no posts and am not seeing this issue.

    Try activating the parent theme to see if the issue persists.

    If it doesn’t, then something is amiss in your child theme. I suggest removing all the template files from your child theme folder and add them back one at a time, checking the page in between each, to figure out what’s gone wrong. You can also temporarily remove all your CSS from the child theme’s stylesheet.

    Let me know how it goes.

    Thread Starter ckwolfling

    (@ckwolfling)

    The problem was with my archives.php file. I had added a couple of divs in part of the loop and put the closing tags at the end of the loop. Moving the closing tags into the loop after the endwhile statement fixed the problem.

    Wrong code:

    <?php /* Start the Loop */ ?>
                    <div class="child-pages grid">
                      <div class="grid-row">
    					<?php while ( have_posts() ) : the_post(); ?>
    
                            <?php
                                /* Include the Post-Format-specific template for the content.
                                 * If you want to override this in a child theme then include a file
                                 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
                                 */
                                get_template_part( 'content-archive', get_post_format() );
                            ?>
    
                        <?php endwhile; ?>
    
                        <?php motif_content_nav( 'nav-below' ); ?>
    
                    <?php else : ?>
    
                        <?php get_template_part( 'no-results', 'archive' ); ?>
    
                    <?php endif; ?>
                  </div>
                </div>

    The fix:

    <?php /* Start the Loop */ ?>
                    <div class="child-pages grid">
                      <div class="grid-row">
    					<?php while ( have_posts() ) : the_post(); ?>
    
                            <?php
                                /* Include the Post-Format-specific template for the content.
                                 * If you want to override this in a child theme then include a file
                                 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
                                 */
                                get_template_part( 'content-archive', get_post_format() );
                            ?>
    
                        <?php endwhile; ?>
                      </div>
                    </div>
                        <?php motif_content_nav( 'nav-below' ); ?>
    
                    <?php else : ?>
    
                        <?php get_template_part( 'no-results', 'archive' ); ?>
    
                    <?php endif; ?>

    Moderator Kathryn Presner

    (@zoonini)

    Glad you found the solution!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Motif: Footer moved on no-results page’ is closed to new replies.