Adam231184 Posted December 28, 2014 Share Posted December 28, 2014 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. Thanks <?php /** * 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>' ); ?> Quote Link to comment Share on other sites More sharing options...
Adam231184 Posted December 30, 2014 Author Share Posted December 30, 2014 Anyone have any ideas? Quote Link to comment Share on other sites More sharing options...
CroNiX Posted December 30, 2014 Share Posted December 30, 2014 My guess is most people on this forum have never used that plugin. You might have better luck posting your question here: https://wordpress.org/support/plugin/woocommerce Quote Link to comment Share on other sites More sharing options...
Adam231184 Posted December 31, 2014 Author Share Posted December 31, 2014 Hi 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. thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.