WooCommerce - show only parent category title



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.

Skills: PHP, WooCommerce, WordPress

See more: want to find php developer in trivandrum, preetileen want in different style and design, n sathiyamoorthy auditors in t nagar, mumbai want in dubai mechanical engineering job, how much money do editors want in south africa, how to predict how many employees you want in the future, woocommerce category parent, wordpress category parent, wordpress sub category parent, category pagination woocommerce, create product category page woocommerce, category description woocommerce, find product category description woocommerce, add header image category pages woocommerce, product category template woocommerce, category page woocommerce wordpress, category descriptions woocommerce, oscommerce add category parent begining urls, custom title category wordpress, add title category oscommerce, oscommerce title category, oscommerce category parent, add category parent begining urls

Project ID: #11790394

Awarded to:


Thank you so much for this great opportunity. I have 9+ years of experience in this field and can provide you my past work sample. I am an expert in WordPress, Magento, Joomla, PSD to HTML conversion, LOGO Desigi More

zł75 PLN in 1 day
(27 Reviews)