I have a very simple job.
This script displays in my shop categories to which the product belongs.:
global $post, $product;
$cat_count = sizeof( get_the_terms( $post->ID, 'product_cat' ) ); ?>
<div class="cat_title"><?php echo $product->get_categories( ', ', '<span class="posted_in">' . _n( '', '', $cat_count, 'woocommerce' ) . ' ', '</span>' );?></div>
I want to list the name ONLY parent category, without sub-categories.
Currently, the script displays a parent category and its subcategories. Must display only parent category.
14 freelancers are bidding on average zł75 for this job
Hi Gone throug you requirement. I want you check my profile and reviews of my customers. Hope you will be one of them soon. We belive in total professionalism. Waiting for your reply. Subrata