WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
print checked child of SPECIFIC parent category (1 post)

  1. Alfred Degens
    Member
    Posted 6 months ago #

    Hi,

    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,
    Mirjam

    http://wordpress.org/plugins/woocommerce/

Reply

You must log in to post.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 6 months ago by Alfred Degens
  • This topic is not resolved
  • WordPress version: 3.6.1