WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. valerama
    Member
    Posted 1 year 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')

    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/

  2. virakyang
    Member
    Posted 1 year 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.

    Thanks

  3. virakyang
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

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

  5. valerama
    Member
    Posted 1 year 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