• Hi everyone,

    Sorry but this question is not really about the woocommerce plugin but I am just hoping that someone might help me here.

    Basically I am trying to achieve a filter for brands. How can I filter the list of terms from the current product category? As of now all I know is to list all terms and this is fine for the shop page.

    Thanks in advance

    <?php
    $args = array(
    	'parent'	=>	0
    );
    $terms = get_terms( 'yith_product_brand', $args );
    foreach( $terms as $term ):
    	$term_link = get_term_link( $term ); ?>
    	<li><a href="<?php echo esc_url( $term_link ); ?>"><?php echo $term->name; ?></a> <span class="count">(<?php echo $term->count; ?>)</span></li>
    <?php
    endforeach; ?>

    https://wordpress.org/plugins/woocommerce/

  • The topic ‘Noob question for get_terms’ is closed to new replies.