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