Archived topic
Display Product Category Description On Woocommerce
7 replies · Started by Clark on April 27, 2020
Hi,
I'm using the site Merch from Generatepress. I'm trying to do the SEO for my product category pages.
I want to put product category descriptions at the top of each product category page. I'm able to add the text when I edit the category page but it says: "The description is not prominent by default; however, some themes may show it."
In this case, it's not prominent as it is not showing on the final website. How do I make the product category description visible?
Thank you!
Hi there,
In "Customize > Layout > WooCommerce", enable the "Page title" option.
Then in "Customize > Additional CSS", find this CSS and remove it:
.tax-product_cat .woocommerce-products-header {
display: none;
}
Let me know if you need more info :)
Thanks that did the job!
You're welcome :)
Hi,
I'm using Merch theme and I would like to have the category description.
I removed the css .tax-product_cat .woocommerce-products-header {
display: none;
}
and it works fine, however I would like the description to be after the products (not before.)
Hi there,
you can use this PHP Snippet to Unhook the product category archive description, and then hook it back in after the shop loop:
add_action( 'wp', function() {
if ( is_product_category() ) {
remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 10 );
}
} );
This doc explains adding PHP:
https://docs.generatepress.com/article/adding-php/
Thank you, this is exactly what I wanted. I added this code and the description is now after the products.
Glad to hear that