Title: Problem getting conditional statement to work in sidebar
Last modified: August 19, 2016

---

# Problem getting conditional statement to work in sidebar

 *  [brianfidler](https://wordpress.org/support/users/brianfidler/)
 * (@brianfidler)
 * [16 years ago](https://wordpress.org/support/topic/problem-getting-conditional-statement-to-work-in-sidebar/)
 * 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>
       </div>
   
       <?php } else { ?>
       <div id="sidebar" class="column span-5 last" >
       <p>this page isn't the home page</p>
       </div>
       <?php } ?>
       ```
   
 * It isn’t working, what am I missing.
 * thanks

Viewing 1 replies (of 1 total)

 *  [threestyler](https://wordpress.org/support/users/threestyler/)
 * (@threestyler)
 * [16 years ago](https://wordpress.org/support/topic/problem-getting-conditional-statement-to-work-in-sidebar/#post-1527589)
 * You could try `if ( is_page('about')` instead?

Viewing 1 replies (of 1 total)

The topic ‘Problem getting conditional statement to work in sidebar’ is closed to
new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [threestyler](https://wordpress.org/support/users/threestyler/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/problem-getting-conditional-statement-to-work-in-sidebar/#post-1527589)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
