Jump to content


This topic is now archived and is closed to further replies.


Wordpress Woocommerce Advice

Recommended Posts

Hi Everyone

I'm working with the woo commerece plugin and i'd like to have a sub heading under the title of each product.

Style and format is sorted however i want a particular Category to show in the sub heading section. I've managed to get as far as showing all categories but i want to narrow this down to just one category that is under a parent category.

Below is the code i am using, could anyone suggest how i could achieve showing any child category selected under a parent category.


* Single Product title
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

global $post, $product;

$cat_count = sizeof( get_the_terms( $post->ID, 'product_cat' ) );

<h1 itemprop="name" class="product_title entry-title"><?php the_title(); ?></h1>

<?php echo $product->get_categories( ', ', '<span class="posted_in">' . _n( 'Artist:', 'Artist:', $cat_count, 'woocommerce' ) . ' ', '.</span>' ); ?>

Share this post

Link to post
Share on other sites



I do have a live post on the site but after a week i had zero comments.


Possibly due to holidays so i'll sit tight.


If i get a solution i will post on here.



Share this post

Link to post
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.