Archived topic
remove woocommerce product category count on shop page
5 replies · Started by Pauline on March 10, 2021
Hi
I would like to remove the woocommerce product category count on the shop page. I have tried pasting the following into "Additional CSS" but neither seem to work. Can you advise what I am doing wrong? Thanks!
.woocommerce-loop-category__title mark.count {
display: none;
}
.woocommerce-loop-category__title mark.count {
display: none;
}
Hi Pauline,
There should be a space between the 2 levels, try this:
.post-type-archive-product .woocommerce-loop-category__title .count {
display: none;
}
Hi Ying
Thanks for looking into this :-) but the CSS does not remove the product count. Do you have something else I could try?
Pauline
Hi there,
try adding this PHP Snippet:
add_filter( 'woocommerce_subcategory_count_html', 'db_remove_cat_prod_count' );
function db_remove_cat_prod_count() {
return;
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Thanks so much David - it worked perfectly :-)
You're welcome