Title: conditional logic?
Last modified: April 19, 2017

---

# conditional logic?

 *  Resolved [judyhicks](https://wordpress.org/support/users/judyhicks/)
 * (@judyhicks)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/conditional-logic-26/)
 * I have posts in 7 categories, and am using your plugin to restrict Recent Posts(
   in the sidebar) to the category assigned to the post. But when there are two 
   or more categories assigned to the post, I get multiple widgets showing in the
   sidebar (Recent Posts duplicated for each category the post was assigned to).
   Is there some kind of logic that says, if more than one category, just use the
   first one to display the widget? thank you!!
 * [http://haasnewsroom.wpengine.com/brexit-expert-panel-gathered-berkeley-haas-explore-whats-next/](http://haasnewsroom.wpengine.com/brexit-expert-panel-gathered-berkeley-haas-explore-whats-next/)

Viewing 1 replies (of 1 total)

 *  [Jeffrey Carandang](https://wordpress.org/support/users/phpbits/)
 * (@phpbits)
 * [9 years ago](https://wordpress.org/support/topic/conditional-logic-26/#post-9143369)
 * Hi,
 * Thank you very much for choosing Widget Options! Regarding your concern, since
   the plugin has the category in which you want the widget to be displayed it will
   be displayed even multiple times. You may want to use Display Widget Logic option
   and use `is_category()` and `!is_category()`. Thanks!
 * Cheers,
    Jeffrey

Viewing 1 replies (of 1 total)

The topic ‘conditional logic?’ is closed to new replies.

 * ![](https://ps.w.org/widget-options/assets/icon-256x256.gif?rev=2513739)
 * [Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets](https://wordpress.org/plugins/widget-options/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-options/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-options/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-options/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-options/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-options/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jeffrey Carandang](https://wordpress.org/support/users/phpbits/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/conditional-logic-26/#post-9143369)
 * Status: resolved