PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, January 8, 2022

[FIXED] How can I remove short description on the shop page in Woocommerce

 January 08, 2022     hook-woocommerce, php, woocommerce, wordpress     No comments   

Issue

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


Solution

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;
    }
}


Answered By - Martin Mirchev
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing