WordPress.org

Forums

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

  1. Alfred Degens
    Member
    Posted 1 year 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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic