Skip to content

Instantly share code, notes, and snippets.

@Willem-Siebe
Last active July 9, 2017 13:36
Show Gist options
  • Save Willem-Siebe/c883eeb2eefb5eea82ab to your computer and use it in GitHub Desktop.
Save Willem-Siebe/c883eeb2eefb5eea82ab to your computer and use it in GitHub Desktop.
Display WooCommerce shop, category and tag description also on next pages. I can only changing it by declaring the same function name in my own functions.php, so that is what I did.
// Display WooCommerce shop, category and tag description also on next pages, see https://gist.github.com/Willem-Siebe/c883eeb2eefb5eea82ab.
function woocommerce_product_archive_description() {
if ( is_post_type_archive( 'product' ) && get_query_var( 'paged' ) >= 0 ) {
$shop_page = get_post( wc_get_page_id( 'shop' ) );
if ( $shop_page ) {
$description = apply_filters( 'the_content', $shop_page->post_content );
if ( $description ) {
echo '<div class="page-description">' . $description . '</div>';
}
}
}
}
function woocommerce_taxonomy_archive_description() {
if ( is_tax( array( 'product_cat', 'product_tag' ) ) && get_query_var( 'paged' ) >= 0 ) {
$description = wpautop( do_shortcode( term_description() ) );
if ( $description ) {
echo '<div class="term-description">' . $description . '</div>';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment