Widget Logic
Widget Logic & Custom Post Types (5 posts)

  1. valerama
    Posted 3 years ago #

    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')


    Once again, Widget Logic has saved my bacon! Probably time to make another donation, been a couple years.


  2. virakyang
    Posted 3 years ago #

    How can I use this plug in on other category, instead of original wordpress. Because at my site 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.


  3. virakyang
    Posted 3 years ago #

    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.

  4. helloari
    Posted 3 years ago #

    what about excluding a custom content type? i tried a few version of this and could not get it to work...

  5. valerama
    Posted 3 years ago #

    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')')

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic