Title: Widget Logic Help
Last modified: August 19, 2016

---

# Widget Logic Help

 *  Resolved [JCornford](https://wordpress.org/support/users/jcornford/)
 * (@jcornford)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/widget-logic-help-2/)
 * Hi
 * I have got a text box widget in my primary sidebar which I would only like to
   appear in the category of Training and it’s sub category Training Diary, I have
   used the code is_category(array(‘Training’, ‘diary’)) which does most of what
   I want, but if I click on the individual post within that category it doesn’t
   appear (I hope that makes sense), is it possible?
 * Many thanks
 * James

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/widget-logic-help-2/#post-1672432)
 * try to use `in_category()`
 * [http://codex.wordpress.org/Conditional_Tags#A_Category_Page](http://codex.wordpress.org/Conditional_Tags#A_Category_Page)
 *  Thread Starter [JCornford](https://wordpress.org/support/users/jcornford/)
 * (@jcornford)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/widget-logic-help-2/#post-1672437)
 * This does what I want, but also makes it appear on my home page which I don’t
   want.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/widget-logic-help-2/#post-1672452)
 * it is getting a bit complex:
    try:
 * `is_category('Training', 'diary') || is_single() && in_category('Training', '
   diary')`
 * that should avoid the frontpage issue
 *  Thread Starter [JCornford](https://wordpress.org/support/users/jcornford/)
 * (@jcornford)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/widget-logic-help-2/#post-1672517)
 * It is now working with in_category(array(‘Training’, ‘diary’)) as there is now
   a tick box that says “Don’t display in homepage”, I didn’t see this before.

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

The topic ‘Widget Logic Help’ is closed to new replies.

## Tags

 * [widget_logic](https://wordpress.org/support/topic-tag/widget_logic/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [JCornford](https://wordpress.org/support/users/jcornford/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/widget-logic-help-2/#post-1672517)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
