Title: Combining Conditional Tags
Last modified: August 22, 2016

---

# Combining Conditional Tags

 *  [webchomp](https://wordpress.org/support/users/webchomp/)
 * (@webchomp)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/combining-conditional-tags-1/)
 * Hi,
 * I’m trying to combine some conditional tags and can’t figure out why this particular
   combination isn’t working for the second half (it works for the tags part but
   not the single posts in categories). This is what I have:
 * if( is_tag( array(10743, 10746, 10737, 10739, 10741, 10744, 10740, 10742, 10745))
   || (is_single() && in_category( array( 115,181,460 ) )) )
 * Any help would be great.
    Thanks, Luke

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

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/combining-conditional-tags-1/#post-5246032)
 * Where is this code being used? It is possible that the $post object is not available.
   Perhaps declaring $post global before your test will help.
 *  Thread Starter [webchomp](https://wordpress.org/support/users/webchomp/)
 * (@webchomp)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/combining-conditional-tags-1/#post-5246070)
 * Hi,
 * I’m using it in widget logic.
 * It works if I use it by itself but not if combing it.
 * Am I missing a bracket in the code or something?
 * Thanks
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/combining-conditional-tags-1/#post-5246084)
 * Try using this:
 *     ```
       global $post;
       if( is_tag( array(10743, 10746, 10737, 10739, 10741, 10744, 10740, 10742, 10745)) || (is_single() && in_category( array( 115,181,460 ) )) )
       ```
   
 *  Thread Starter [webchomp](https://wordpress.org/support/users/webchomp/)
 * (@webchomp)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/combining-conditional-tags-1/#post-5246192)
 * Thanks, but no that didn’t work either.
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/combining-conditional-tags-1/#post-5246193)
 * Try removing the ‘if’.

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

The topic ‘Combining 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/)
 * 5 replies
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/combining-conditional-tags-1/#post-5246193)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
