Skip to content

Instantly share code, notes, and snippets.

@Vitkalova
Last active June 11, 2018 20:18
Show Gist options
  • Save Vitkalova/3c4630f156fb730191d7e7496003fb0c to your computer and use it in GitHub Desktop.
Save Vitkalova/3c4630f156fb730191d7e7496003fb0c to your computer and use it in GitHub Desktop.
Display WooCommerce Product Category description on every page except first page
/* WooCommerce displays the product category description only on the first page of the category archive
and the category description will not be shown on page 2, 3, etc
Code below helps to to display the category description on all the paginated pages
Add the following code to your theme’s functions.php file: */
function show_taxonomy_archive_description() {
if ( is_tax( array( 'product_cat', 'product_tag' ) ) && get_query_var( 'paged' ) != 0 ) {
$description = wc_format_content( term_description() );
if ( $description ) {
echo '<div class="term-description">' . $description . '</div>';
}
}
}
add_action( 'woocommerce_archive_description', 'show_taxonomy_archive_description');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment