Support » Fixing WordPress » Conditional Tags Issue

  • Resolved nathancope

    (@nathancope)


    Hey, I am trying to display different content for different products in each tags using conditional tags in WooCommerce.

    The issue is that it is displaying nothing at all!

    <?php
    if ( is_product_tag( ‘tag1’ ) ) {
    echo get_touchcarousel(4);
    } elseif ( is_product_tag( ‘tag2’ ) ) {
    echo get_touchcarousel(3);
    } elseif ( is_product_tag( ‘tag3’ ) ) {
    echo get_touchcarousel(6);
    } elseif ( is_product_tag( ‘tag4’ ) ) {
    echo get_touchcarousel(5);
    }
    ?>

Viewing 1 replies (of 1 total)
  • Thread Starter nathancope

    (@nathancope)

    For anyone having same issue, I have resolved by changing the conditional tag to a post ID instead:

    if( $product->id == 116 && is_product() )
    echo( get_touchcarousel(3) );

Viewing 1 replies (of 1 total)
  • The topic ‘Conditional Tags Issue’ is closed to new replies.