Enfold – Display Excerpt on WooCommerce Product Grid Element
If you are using the Enfold theme and have set up a WooCommerce shop you will notice that the plugin adds a few extra elements to the Avia Builder. One specific element is the Product Grid that allows you to build your own shop page. By default the element shows the Products featured image, the name of the product and the price of the product but it does not show the Product Short Description (i.e. the excerpt).
To enable this just add the following code to your theme’s functions.php file.
/* --------------------------------------------------------------------------
Add WooCommerce Short Decription on Product Grid element
-------------------------------------------------------------------------- */
function avia_category_page_new_div() {
global $post;
$desc = '<div class="category-desc">' .apply_filters( 'woocommerce_short_description', $post->post_excerpt ). '</div>';
echo $desc;
global $product;
echo $product->list_attributes();
}
add_action( 'woocommerce_after_shop_loop_item_title', 'avia_category_page_new_div', 20);

Leave a Reply
Want to join the discussion?Feel free to contribute!