Skip to content

Snippet: Display Product Short Description on Product Entries

The following snippet can be used to display the WooCommerce short product description in the product entry (below the title). If you are creating a custom card for your products this can be done by using the theme's Post Excerpt element.

/**
 * Display the short product description on your product Entries.
 *
 * @link https://total.wpexplorer.com/docs/snippets/display-product-short-description-on-product-entries/
 */
add_action( 'woocommerce_after_shop_loop_item_title', function() {
    global $post;
    $short_description = apply_filters( 'woocommerce_short_description', $post->post_excerpt );
    if ( $short_description ) {
        echo '<div class="my-product-entry-description">' . wp_kses_post( $short_description ) . '</div>';
    }
}, 50 );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top