description!
-
I would like to display product’s category description on products page, not the single product page but on page where the selected category products are listed. This is the code i am using,
function new_excerpt_more( $more ) { return '... <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">read more about '. get_the_title() .'</a>'; } add_filter( 'excerpt_more', 'new_excerpt_more' ); add_action( 'woocommerce_after_subcategory_title', 'custom_add_product_description', 12); function custom_add_product_description ($category) { $cat_id = $category->term_id; $prod_term = get_term($cat_id,'product_cat'); $description = $prod_term->description; echo '<div>' .$description. '</div>'; }This does display the description i need but on the page where the categories are listed, I need this to be on the products page where the selected category products are displayed.
I will really appreciate any help here
The topic ‘description!’ is closed to new replies.