Display Category Description on Shop page
-
I have my main Woocommerce Shop Page/Product Archive set to ‘show subcategories’. By default Woocommerce only displays the following on the Shop page:
Category Image
Category Title
Category item countCan anyone advise how I get the Category Description to show up, either via functions.php or a modification to the relevant Woocommerce page (copied to my theme)?
On further inspection it seems that I need to add something to ‘content-product_cat.php’.
Looking at ‘archive-product.php’ I would have thought that copying the following code into ‘content-product_cat.php’ would do it but it makes no difference:
<?php do_action( 'woocommerce_archive_description' ); ?>
I’ve also tried the following code in my ‘functions.php’ file :
add_action('woocommerce_after_subcategory_title','add_cat_desc', 5); function add_cat_desc() { echo " <?php do_action( 'woocommerce_archive_description' ); ?> "; }
but when I view the source for the shop page, the php line is commented out, instead of being executed.
Any help very much appreciated, and sorry in advance for my PHP ignorance!
- The topic ‘Display Category Description on Shop page’ is closed to new replies.