Title: [Plugin: Widget Logic] category and category posts error using widget logic
Last modified: August 19, 2016

---

# [Plugin: Widget Logic] category and category posts error using widget logic

 *  [Bird](https://wordpress.org/support/users/bird/)
 * (@bird)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/plugin-widget-logic-category-and-category-posts-error-using-widget-logic/)
 * I’m using widget logic on my blog and so far it’s working fantastically except
   for one thing. I would like a certain widget to display when looking at a particular
   category and all the posts in that category. In the plugin directory FAQ for 
   widget logic I found this bit of code and put in my own category name as you 
   see
 * `is_category(nature) || (is_single() && in_category(nature)`
 * …but when I use it, I get this error message in my sidebar where the widget should
   appear
 * Parse error: syntax error, unexpected ‘;’ in /home/thebirdi/public_html/wp-content/
   plugins/widget-logic/widget_logic.php(154) : eval()’d code on line 1
 * I’m not a coder and this means nothing to me 🙂 Any ideas? (and apologies if 
   it’s just me doing something obviously stupid)

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

 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/plugin-widget-logic-category-and-category-posts-error-using-widget-logic/#post-1151208)
 * try putting nature inside quotes
 * ‘nature’
 *  Thread Starter [Bird](https://wordpress.org/support/users/bird/)
 * (@bird)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/plugin-widget-logic-category-and-category-posts-error-using-widget-logic/#post-1151301)
 * Thank you for replying alanft (took me a while to spot that you had)
 * I tried what you suggested and had exactly the same error come up, so although
   I guess forgetting the quotes wasn’t strictly right it wasn’t causing the problem.
 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/plugin-widget-logic-category-and-category-posts-error-using-widget-logic/#post-1151302)
 * there’s also an end bracket ) missing from the code you quoted, if that’s not
   a typing error here. should be
 * is_category(‘nature’) || (is_single() && in_category(‘nature’))
 *  Thread Starter [Bird](https://wordpress.org/support/users/bird/)
 * (@bird)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/plugin-widget-logic-category-and-category-posts-error-using-widget-logic/#post-1151307)
 * Thank you very much alanft, that worked, and now it’s been pointed out I can 
   see it for myself. I think it’s time I learned for myself how all this stuff 
   fits together. Widget logic is great; at last I can have my website just how 
   I want it.

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

The topic ‘[Plugin: Widget Logic] category and category posts error using widget
logic’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [Bird](https://wordpress.org/support/users/bird/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/plugin-widget-logic-category-and-category-posts-error-using-widget-logic/#post-1151307)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
