Home / Archive / Move WooCommerce Category Description Below Products
Duplicate Snippet

Embed Snippet on Your Site

Move WooCommerce Category Description Below Products

The following snippet moves the WooCommerce description from the default location (page header subheading) to below your products. Don't forget though that you can always create a dynamic template instead for your WooCommerce categories and have full control over the layout.

Code Preview
php
<?php
 add_action( 'init', function() {
	// Disable subheading on product cats
	add_filter( 'totaltheme/page/header/has_subheading', function( $check ) {
		if ( is_tax( 'product_cat' ) ) {
			$check = false;
		}
		return $check;
	} );
	// Display description below loop
	add_action( 'wpex_hook_content_bottom', function( $bool ) {
		if ( is_tax( 'product_cat' ) ) {
			echo '<div class="wpex-mt-40">';
			get_template_part( 'partials/term-description' );
			echo '</div>';
		}
	} );
} );

Comments

Add a Comment

  1. Dear WPCode Team
    Can I use the above code in any theme? I use the Astra theme and I added the above code, but the code is not working. Products description not showing below the products inn products category page.

    1. This snippet is specific for our Total WordPress theme so it won’t work on any other theme. You will need to contact the Astra theme developers to see how their theme is coded and how to modify things accordingly.