Problem getting conditional statement to work in sidebar (2 posts)

  1. brianfidler
    Posted 5 years ago #

    I've got the following code which should be displaying a different block of code in my sidebar if the user is on the home page.

    I've set up my front page to be a static page and to use a custom template. It's doing all of that correctly, it's just as if my sidebar isn't seeing the page as the front page.:

    <?php if (is_front_page() ) { ?>
    <div id="sidebar-home" class="column span-5 last">
    <p>this page IS the home page</p>
    <?php } else { ?>
    <div id="sidebar" class="column span-5 last" >
    <p>this page isn't the home page</p>
    <?php } ?>

    It isn't working, what am I missing.


  2. threestyler
    Posted 5 years ago #

    You could try if ( is_page('about') instead?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.