Title: php conditional statement not working in sidebar&#8230;
Last modified: August 18, 2016

---

# php conditional statement not working in sidebar…

 *  [axiomjunglist](https://wordpress.org/support/users/axiomjunglist/)
 * (@axiomjunglist)
 * [19 years ago](https://wordpress.org/support/topic/php-conditional-statement-not-working-in-sidebar/)
 * I’ve gotten some really helpful answers to some burning questions here. I do 
   have one more that is really nagging.
 * Here is the current WordPress site live:
 * [http://nahn-oregon.org/](http://nahn-oregon.org/)
 * I’m trying (if possible) to fill the bottom sidebar content with a query using
   the code found here:
 * [http://latestpost.pastebin.co.uk/3890](http://latestpost.pastebin.co.uk/3890).
 * Now it does work, it populates the bottom sidebar div with the right content 
   I’m asking for, but it also places post data from that category into the main
   content area on every page as well. That’s no good. Right now I just have some
   html filler in there to show how I would like the sidebar to look (and how the
   rest of the pages should work). I’ve tried re-naming the bottom sidebar div, 
   looking for open tags that should be closed & checking my style sheet for errors.
   So far I haven’t figured it out.
 * Anybody out there have an idea of why the code would flow into the main content
   area using the code from the link above? The catagory ID is correctly assigned.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [19 years ago](https://wordpress.org/support/topic/php-conditional-statement-not-working-in-sidebar/#post-569752)
 * Is that a custom theme or do you have a link to where you downloaded the theme?
 * In what template file (e.g. sidebar.php) are you placing that code?
 *  Thread Starter [axiomjunglist](https://wordpress.org/support/users/axiomjunglist/)
 * (@axiomjunglist)
 * [19 years ago](https://wordpress.org/support/topic/php-conditional-statement-not-working-in-sidebar/#post-569819)
 * It’s custom, and yes the code resides in the sidebar. The theme was created entirely
   from scratch.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘php conditional statement not working in sidebar…’ is closed to new replies.

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [not](https://wordpress.org/support/topic-tag/not/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [working](https://wordpress.org/support/topic-tag/working/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [axiomjunglist](https://wordpress.org/support/users/axiomjunglist/)
 * Last activity: [19 years ago](https://wordpress.org/support/topic/php-conditional-statement-not-working-in-sidebar/#post-569819)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
