Title: conditional tags
Last modified: June 15, 2017

---

# conditional tags

 *  Resolved [antkelly](https://wordpress.org/support/users/antkelly/)
 * (@antkelly)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/conditional-tags-20/)
 * Hi – I can use the following php to add content to all posts but how would I 
   target events posts only? Also how would I target an event category with slug‘
   training'(ID 32). Tried lots of combinations but can’t figure it out!
    `<?php
   if ( is_single() ) : ?>content<?php endif; ?>`

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

 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/conditional-tags-20/#post-9232018)
 * Hi,
 * You’d need to use
 * `is_singular( 'event' )`
 * For the category, try is_tax().
 * [https://codex.wordpress.org/Function_Reference/is_tax](https://codex.wordpress.org/Function_Reference/is_tax)
 *  Thread Starter [antkelly](https://wordpress.org/support/users/antkelly/)
 * (@antkelly)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/conditional-tags-20/#post-9233809)
 * Thank you!
    `is_singular( 'event' )` worked perfectly for all events posts 🙂
   is_tax() didn’t work for event categories though, I am targetting all individual
   posts in a specific event category (not archive pages) is there anything else
   I can try?
 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/conditional-tags-20/#post-9235496)
 * What code did you use for _is\_tax _?

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

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

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=1039078)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/conditional-tags-20/#post-9235496)
 * Status: resolved