woocommerce_product_archive_description

Show a shop page description on product archives.

Description

woocommerce_product_archive_description(); 

Usage

  1. if ( !function_exists( 'woocommerce_product_archive_description' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-template-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = woocommerce_product_archive_description(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-template-functions.php  
  1. function woocommerce_product_archive_description() { 
  2. // Don't display the description on search results page 
  3. if ( is_search() ) { 
  4. return; 
  5.  
  6. if ( is_post_type_archive( 'product' ) && 0 === absint( get_query_var( 'paged' ) ) ) { 
  7. $shop_page = get_post( wc_get_page_id( 'shop' ) ); 
  8. if ( $shop_page ) { 
  9. $description = wc_format_content( $shop_page->post_content ); 
  10. if ( $description ) { 
  11. echo '<div class="page-description">' . $description . '</div>';