Title: Widget Logic &amp; Custom Post Types
Last modified: August 20, 2016

---

# Widget Logic & Custom Post Types

 *  [valerama](https://wordpress.org/support/users/valerama/)
 * (@valerama)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/widget-logic-custom-post-types/)
 * Big fan of this plugin! I found a solutions, so I’m posting here.
 * I was having trouble defining a widget that I only wanted to show up on certain
   CPT taxonomy pages. Custom post type of ‘books’ with a taxonomy of ‘awards’. 
   Each of the awards pages needed different widget content.
 * found this: `is_tax( 'flavor', 'mild')`
 * As is fairly normal with wordpress codex it wasn’t explained well but when I 
   paid attention to the content I *got* it. think of it this way…
 * `is_tax('taxonomy_name', 'taxonomy_term')`
 * In my case: `is_tax( 'awards', 'moms-choice-award')`
 * Voilá!
 * Once again, Widget Logic has saved my bacon! Probably time to make another donation,
   been a couple years.
 * [http://wordpress.org/extend/plugins/widget-logic/](http://wordpress.org/extend/plugins/widget-logic/)

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

 *  [virakyang](https://wordpress.org/support/users/virakyang/)
 * (@virakyang)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/widget-logic-custom-post-types/#post-2966446)
 * How can I use this plug in on other category, instead of original wordpress. 
   Because at my site [http://www.keyrealestate.com.kh](http://www.keyrealestate.com.kh).
   I have a Property Categories, such as Phnom Penh, Siem Reap and so on. So how
   can I use widget logic to show on these specific categories?
 * *This is not a default WordPress Template.
 * Thanks
 *  [virakyang](https://wordpress.org/support/users/virakyang/)
 * (@virakyang)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/widget-logic-custom-post-types/#post-2966447)
 * Thanks you so much, I’ve tried it and it work really well. Thankssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.
 * I’ve been searching around for weeks. You are my hero.
 *  [helloari](https://wordpress.org/support/users/helloari/)
 * (@helloari)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/widget-logic-custom-post-types/#post-2966452)
 * what about excluding a custom content type? i tried a few version of this and
   could not get it to work…
 *  Thread Starter [valerama](https://wordpress.org/support/users/valerama/)
 * (@valerama)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/widget-logic-custom-post-types/#post-2966453)
 * You can hide the widget if the terms are NOT matched by using the exclamation
   point before the function, i.e.,
 * `!is_tax('taxonomy_name', 'taxonomy_term')`
 * If you need to hide it for multiple terms, in that second declaration (where 
   it says ‘taxonomy_term’) you could put an array:
 * `!is_tax('taxonomy_name', 'array('first_taxonomy_term','second_taxonomy_term','
   third_taxonomy_term')')`

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

The topic ‘Widget Logic & Custom Post Types’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/widget-logic_c8dde5.svg)
 * [Widget Logic](https://wordpress.org/plugins/widget-logic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-logic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-logic/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-logic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-logic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-logic/reviews/)

## Tags

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

 * 4 replies
 * 3 participants
 * Last reply from: [valerama](https://wordpress.org/support/users/valerama/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/widget-logic-custom-post-types/#post-2966453)
 * Status: not resolved