If you want to show the “short description” field on the products that are on your homepage or in the loop, here’s the PHP code to add to your functions.php

Show Product Description Inside the Loop – PHP


/**
 * @snippet       Show product short description on the homepage WooCommerce
 * @how-to        Get CustomizeWoo.com FREE
 * @sourcecode    https://businessbloomer.com/?p=257
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 2.4.7
 */

add_action( 'woocommerce_after_shop_loop_item_title', 'bbloomer_ins_woocommerce_product_excerpt', 35, 2);

function bbloomer_ins_woocommerce_product_excerpt() {
     if ( is_home() ) {
     echo '<span class="excerpt">';
     the_excerpt();
     echo '</span>';
     }
}

Show Product Description Outside the Loop – PHP


/**
 * @snippet       Show product short description on the homepage WooCommerce
 * @how-to        Get CustomizeWoo.com FREE
 * @sourcecode    https://businessbloomer.com/?p=257
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 2.4.7
 */

echo apply_filters( 'the_content', get_post_field('post_content', $product_id) );

Share:

Leave a Reply