skip to Main Content

I am using Astra Theme + Elementor and WooCommerce. I have added the following styling rule in the custom CSS section of the Astra theme to hide the category description in the category archives:

.term-description {
    display: none;
}

However, it hides only for the admin when logged in. When I log out, I still can see the category description, How can I please fix this to hide the category description for everyone (all users and visitors).

For example, one of the category pages I need to hide description for:
https://electrobayti.ma/petit-electromenager/mixeur/

I was expecting to hide the category description for all users and visitors.

2

Answers


  1. Instead of CSS, you can try the following function to hide description from category archives:

    add_action('woocommerce_archive_description', 'remove_category_archive_description', 2 );
    function remove_category_archive_description(){
        if( is_product_category() ) {
            remove_action('woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
        }
    }
    

    Code goes in function.php file of your child theme (or in a plugin). Tested and works (using Storefront theme).

    Login or Signup to reply.
  2. I checked it.. The "term-description" is hidden!

    here its screen shot

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search