To add description content on your WooCommerce product category anding page, you need to add description and other meta tags in your category using Yoast SEO plugin.
The description will be added just below the page title. If you want to move the description under your product list, add following code in your functions.php file present in your theme directory.
The remove/add actions you are using does work — without keeping the “top” instance. Please try the following (using the correct single quotes):
The following code will first remove the description from its current position and then will add it after the products list.
remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); remove_action( 'woocommerce_archive_description', 'woocommerce_product_archive_description', 10 ); add_action( 'woocommerce_after_main_content', 'woocommerce_taxonomy_archive_description', 40 ); add_action( 'woocommerce_after_main_content', 'woocommerce_product_archive_description', 40 );
Adding Title on WooCommerce Product Category Landing Page
If WooCommerce Product Category title is missing from your lading page, you can add it using the following code by putting in the functions.php file:
function pim_add_category_title() { global $post; $current_category = single_cat_title("", false); echo '<div class="product-category"> <h1 class="post-title">'. $current_category .'</h1> </div>'; } add_action( 'woocommerce_before_main_content', 'pim_add_category_title', 40 );
These little changes will help your product category landing page seo and will also bring products to top.
Hope that helps.
Hello Ali,
Thanks for the post. This works perfectly on product category pages. But not on the main shop page. Do you know how to achieve moving the description below the products loop on the main shop page using PHP hooks and filters?
Thank you in advance
Try following code, add it in your functions.php file.