WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Hide footer in static pages (4 posts)

  1. null66913
    Member
    Posted 4 years ago #

    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?

  2. 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.

  3. null66913
    Member
    Posted 4 years ago #

    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).

  4. 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().

Topic Closed

This topic has been closed to new replies.

About this Topic