WordPress.org

Ready to get started?Download WordPress

Forums

Post Type Category Query with an If Statement for a specific category (2 posts)

  1. steponafish
    Member
    Posted 1 year ago #

    Hello, I'm trying to query custom post-type categories and also have an IF statement. EXAMPLE: IF the category == "Case Studies" - show an image on top of the posted thumbnail. But I can't seem to get it working. I have this little snippet of code that has worked, but only if the category "Case Study" is the only thing on the page.

    <?php
    if (($term !== 'Case Studies') && ($term !== 'case-studies') ){
    } else { ?>
    <span class="ribbon"></span><span class="ribbon_icon"></span>
    <? } ?>

    Can any one help me?

  2. steponafish
    Member
    Posted 1 year ago #

    I just thought of something... Could I use something like...

    $terms = is_tax( 'TAXOMONY-NAME' );
    if($terms == 'case-studies') { SHOW IMAGE }

Topic Closed

This topic has been closed to new replies.

About this Topic