• Resolved null66913

    (@null66913)


    I would like to hide the footer of a blog in all the static pages. I guess that I must use some if/else conditional on footer.php but I’m not a programmer and I don’t know how to do it exactly, any suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    There are no static pages, persey, but I’m assuming you mean in pages, and not in posts.

    If so, try putting this in the footer.php file:

    <?php
    
    if ( is_page() ) {
        // Show nothing.
    } else {
        // Your footer stuff goes here.
    }
    ?>

    Just keep in mind you’ll need to put your tags for </body>, </html> and any divs OUTSIDE this if loop, or you’ll break things.

    Thread Starter null66913

    (@null66913)

    Thank you, but someone explain me an easier way to do that. In case anyone has the same problem, you just have to delete <?php get_footer(); ?> in the page template (page.php).

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    FYI – You really don’t want to exclude the get_footer() call from your blog pages, as that calls more than just the footer content. You’ve probably made your webpage invalid HTML now, as well as introducing other issues with plugins that use the calls in get_footer().

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide footer in static pages’ is closed to new replies.