Title: Conditional tags
Last modified: August 20, 2016

---

# Conditional tags

 *  Resolved [Sam-30](https://wordpress.org/support/users/sam-30/)
 * (@sam-30)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/conditional-tags-10/)
 * I use a plugin to show widgets on a page or post I want and don’t want.
    (widget
   logic)
 * I have done some reseach about conditional tags, and I now a little now.
    But
   got 2 questions.
 * The following tag:
    **is_single ( array (43842,43846, 43849) ) && in_category(‘
   388’ ) ** This tag shows a widget in 3 posts of 1 categorie.
 * – What do I have to change when I don’t want to show te widget in that 3 posts,
   so it shows anywhere accept those 3 posts?
 * – And what if I have also 2 other posts in a other categorie?
 * Cheers,
    Sam

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

 *  [Mario Peshev](https://wordpress.org/support/users/nofearinc/)
 * (@nofearinc)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/conditional-tags-10/#post-3148391)
 * I’m not really a user of the plugin, but you might try:
 * ! ( is_single ( array ( 43842, 43846, 34849 ) ) ) && in_category( 388 )
 * for the first case, and for the second one:
 * ( is_single ( array ( 43842,43846, 43849 ) ) && in_category( 388 ) ) || ( is_single(
   array (33333, 23456 ) ) && in_category( 342 ) )
 *  Thread Starter [Sam-30](https://wordpress.org/support/users/sam-30/)
 * (@sam-30)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/conditional-tags-10/#post-3148400)
 * ! ( is_single ( array ( 43842, 43846, 34849 ) ) ) && in_category( 388 )
    **Does
   not work, it disapear everywhere.** Does **!** mean don’t show? **Any one now
   how I can get the tag right?** I want to show a widget everywhere on the website,
   only not in the 3 posts.
 * ( is_single ( array ( 43842,43846, 43849 ) ) && in_category( 388 ) ) || ( is_single(
   array (33333, 23456 ) ) && in_category( 342 ) )
    **That works fine! Thanks a 
   lot!**
 *  Thread Starter [Sam-30](https://wordpress.org/support/users/sam-30/)
 * (@sam-30)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/conditional-tags-10/#post-3148413)
 * It is solved!
 * The tag is ! is_single ( array ( 43842, 43846, 34849 ) ) && in_category( 388 )
 * And I had another plugin for logic and I don’t think they were matching together.
 * It works great now and can do a lot now!
    THANKS

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

The topic ‘Conditional tags’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Sam-30](https://wordpress.org/support/users/sam-30/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/conditional-tags-10/#post-3148413)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
