In this post, i’ll show you how easy it is to add some text or any other type of content to one or more WooCommerce product category archive pages.
WooCommerce includes a huge range of hooks which enable you to add extra content anywhere.
On top of this, you can also use the WooCommerce conditional tags in a custom function with any Woo hook to add content.
The 1st method uses a basic custom function which you can add to the end of your child themes functions.php file.
The 2nd method enables you to add different text for each product category and default text for any category not included in the code:
Both solutions enable you to easily change both the:
- WooCommerce Action Hook – woocommerce_archive_description
- WooCommerce Conditional Tag – is_product_category()
Vicki P says
Hi,
I am trying to work out how to have the category description show on every page of the products – I have 30 products which goes over 5 pages and the category description only shows on the first page
Thanks
Brad Dalton says
Use the correct woocommerce hook and conditional tag
Josh says
While adding text via functions.php works, it will make it impossible to edit for anyone you don’t want to give administrator rights to. If you’re handing a site over to a client, you don’t want them messing around in functions.php. There’s a little plugin called Category TinyMCE that adds a WYSIWYG editor to each category page. That would probably be a better option – http://wordpress.org/plugins/categorytinymce/
Brad Dalton says
But does it work with custom post types generated by plugins?
aka says
That’s cool. But do you know a way how to add only text when categories are shown?
If any product is listed, don’t show the category description.
Brad Dalton says
Must be a conditional tag for that.
WooCommerce include a huge range of hooks and conditional tags you can use to modify the default output their plugin generates.