WordPress.org

Forums

How to remove footer from individual pages? (6 posts)

  1. pushkin
    Member
    Posted 3 years ago #

    I'm trying to remove footer from individual pages using the following css code (with the page id, obviously, pointing to the page on my site I want to change)

    body.page-id-2800 td#footer {
    display:none;
    }

    and applying it in the custom css file – but without success. Does this code look right? Is this the correct way of going about removing the footer from individual pages? Thanks

  2. alchymyth
    Forum Moderator
    Posted 3 years ago #

    Does this code look right?

    nobody will be able to tell without seeing your site live.

    using a tool such as Firebug http://getfirebug.com/ might help you to get clarity about what style to use.

  3. pushkin
    Member
    Posted 3 years ago #

    My mistake. Here's my site – http://golovegreece.com/

    What I want to do is have ads in the footer on the front page, but not have these ads appear in subsequent pages.

    I've got Firebug. How would I use it in this instance? Thanks

  4. Harrison Ortega
    Member
    Posted 3 years ago #

    This video may help you with firebug: http://www.youtube.com/watch?v=3KdNRZS-uSg

    The code you created would never work. That style does not exist on your theme.
    The styles on your footer is used sitewide(all pages/posts) so, using "display none" is not going to work.

    One method would be replicating your footer.php, naming that copy to footer-2.php
    Now, go to page.php, at the bottom, find and change the get_footer so it looks like:

    <?php get_footer('2'); ?>

    By this way, your posts will use footer.php and pages, footer-2.php. Add your ads to footer.php

  5. alchymyth
    Forum Moderator
    Posted 3 years ago #

    in your case it might work with:

    #footer { display: none; }
    .home #footer { display: block; }

    however, it might be more efficient to wrap the ad code into a conditional statement;
    in footer.php:

    example:

    <?php if( is_home() || is_front_page() ) : ?>
    the code for the two ads here
    <?php endif; ?>

    http://codex.wordpress.org/Conditional_Tags

  6. pushkin
    Member
    Posted 3 years ago #

    I tried both the footer-2.php method and using the code:

    #footer { display: none; }
    .home #footer { display: block; }

    and both seemed to do the trick, giving me greater control of where ads appear in page and post footers, which is what I was after, so many thanks for this.

Topic Closed

This topic has been closed to new replies.

About this Topic