Prevent empty term-description div

This commit is contained in:
Geert De Deckere 2012-12-28 19:36:03 +01:00
parent 187f41b520
commit e008ba1ad3
1 changed files with 3 additions and 2 deletions

View File

@ -291,8 +291,9 @@ if ( ! function_exists( 'woocommerce_taxonomy_archive_description' ) ) {
* @return void
*/
function woocommerce_taxonomy_archive_description() {
if ( is_tax( array( 'product_cat', 'product_tag' ) ) && get_query_var( 'paged' ) == 0 )
echo '<div class="term-description">' . wpautop( wptexturize( term_description() ) ) . '</div>';
$term_description = term_description();
if ( $term_description && is_tax( array( 'product_cat', 'product_tag' ) ) && get_query_var( 'paged' ) == 0 )
echo '<div class="term-description">' . wpautop( wptexturize( $term_description ) ) . '</div>';
}
}
if ( ! function_exists( 'woocommerce_product_archive_description' ) ) {