Last active
July 9, 2017 13:36
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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