<https://10web.io/blog/how-to-add-short-description-in-woocommerce-shop-page/>
Add to functions.php of child theme. 2 ways:
This one keeps the formatting of the short description (line feeds etc)
// Add the short description to the shop loop.
add_action('woocommerce_after_shop_loop_item',
'lc_add_short_description', 40);
function lc_add_short_description() {
global $product;
if ( ! $product->get_short_description() ) return;
echo '<div class="woocommerce_short_description">' .
wc_format_content($product->get_short_description()) . '</div>';
}
Code language: PHP (php)
With action hook. This one removes the formatting of the short description (line feeds etc)
add_action('woocommerce_after_shop_loop_item_title',
'custom_add_short_description', 9);
function custom_add_short_description() {
global $product;
if ( has_excerpt( $product->get_id() ) ) {
echo '<div class="woocommerce_short_description">' .
get_the_excerpt( $product->get_id() ) . '</div>';
}
}
Code language: PHP (php)
Placement is based on the hook you use (red). Will be a hyperlink if in the loop item. <https://woocommerce.github.io/code-reference/files/woocommerce-templates-content-product.html#source-view.57>
- woocommerce_before_shop_loop_item
- woocommerce_before_shop_loop_item_title
- woocommerce_shop_loop_item_title
- woocommerce_after_shop_loop_item_title
- woocommerce_after_shop_loop_item