Is there a way to get the selected item of a specific parent category listed in the single product page?
I have in taxonomy "product-cat" a parent category "artists" and the names of the artists are listed as the child of parent "artists".
In meta.php is this code:
<?php $size = sizeof( get_the_terms( $post->ID, 'product_cat' ) ); echo $product->get_categories( ', ', '<span class="posted_in">' . _n( 'Category:', 'Categories:', $size, 'woocommerce' ) . ' ', '.</span>' ); ?>
This code print a list of all selected categories on the product page.
But I would like to have only the SELECTED child of "artists" printed.
Can someone help me with this code?
Thanks in advance,