Home > database >  How can I remove short description on the shop page in Woocommerce
How can I remove short description on the shop page in Woocommerce

Time:12-22

Shortly, I want to just remove the short description on the shop/archive page. I added two images. it will be helpful for your understanding. I tried many combination but not working on shop page.

I found a code but it was just removed on the product page.

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );

function woocommerce_template_single_excerpt() {
        return;
}

enter image description here

enter image description here

CodePudding user response:

Option 1: To remove description entirely place the following action in your child theme functions.php

remove_action('woocommerce_after_shop_loop_item_title','electro_template_loop_product_excerpt', 80 );

Option 2: To override the function place the following function in your child theme functions.php file

function electro_template_loop_product_excerpt() {
    global $post;
    // In case you want to limit description for example or output different content there
    if ( ! is_object( $post ) || ! $post->post_excerpt || $post->post_excerpt ) {
        return;
    }
}
  • Related