Support » Fixing WordPress » Different footer for home page

  • TobyH

    (@tobyh)


    I know this topic has been covered extensively, but I can’t seem to make it work. I am using the twenty eleven theme (reconfigured obviously).

    I want to make a different footer for the home page:

    http://www.meagansegal.com

    All I want to do is remove the “home” button on the left for the home page. I created a new footer called “footer-home.php” and removed the link in question.

    Here is what I put into the index.php page:

    <?php
    if ( is_home() ) :
    get_footer(‘home’);
    else :
    get_footer();
    endif;
    ?>

    Where am I going wrong? Any help would be greatly appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Max

    (@clementsm)

    Well, it may be that the page you are using for your front page may not actually be “home”, so just substitute is_home() with is_front_page() if you set a static front page in the backend.

    I would say though, just as an aside, that a simpler method would be to just to wrap te home list item with the if statement above in your footer.php file, then you don’t need an additional footer-home.php file.

    TobyH

    (@tobyh)

    I like the second option much better!

    So you’re saying if I put inside the list item like so:

    <li class=”homeNav” ?php
    if ( is_home() ) :
    get_footer(‘home’);
    else :
    get_footer();
    endif;
    ?>

    That would work?

    Michael

    (@alchymyth)

    Forum Moderator

    try to utilize the body_class() output of the home page .home to hide the ‘home’ nav tab on the home page:

    .home #navBottom .homeNav {display:none;}
    Max

    (@clementsm)

    @alchymyth Oh yes — so simple — 🙂

    TobyH

    (@tobyh)

    Worked perfectly!! Thank you so much!!! Lovin WordPress…

    michael.mariart

    (@michaelmariart)

    I’d be careful hiding things like this using CSS. The main reason not ot is that the Google still sees your source code and knows that there’s a menu there with a lot of links in it, but it’s hidden from users. In their eyes, this can be considered “cloaking” and can penalise your site in search rankings. This might not be a big concern for you, but it’s something to remember.

    Your PHP function was almost there to make this work. The only thing that I would tell you to change is to have is_front_page() instead of is_home(). I know this sounds a bit silly, but I’ve been caught with this a few times before.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Different footer for home page’ is closed to new replies.