[Resolved] Niche Template ( Woocommerce Nav )

Home Forums Support [Resolved] Niche Template ( Woocommerce Nav )

Home Forums Support Niche Template ( Woocommerce Nav )

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1578374
    FunkyCss

    Hi, there is any way in the template of Niche to display in the custom woocommerce nav of the products to display the tags so to make it like filtering?

    Thank you in advance

    #1578670
    David
    Staff
    Customer Support

    Hi there,

    should be as simple as swapping out the category terms for tag terms like so:

    <?php
    $tag_args = array(
        'orderby'    => 'name',
        'order'      => 'asc',
        'hide_empty' => true,
    );
     
    $product_tags = get_terms( 'product_cat', $cat_args );
     
    if ( ! empty( $product_tags ) ) {
        echo '<ul class="woo-cat-nav">';
    	foreach ( $product_tags as $key => $tag ) {
    	    printf( 
    	    '<li>
    		<a href="%1$s">
    		%2$s
    		</a>
    	     </li>',
    		get_term_link( $tag ),
    		$tag->name
    	    );
    	}
        echo '</ul>';
    }
    ?>
    #1584561
    FunkyCss

    Hi Thank you it works!

    #1584592
    David
    Staff
    Customer Support

    Awesome – glad to be of help

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.