I’m running WordPress v6.3.1 with Woocommerce v8.1.1 and the Deli theme. I have added a Product categories widget to the sidebar, but the number of products in each category shows in the sidebar. How can I suppress this? I already have the functions.php edit to suppress the numbers on the Shop page, but it doesn’t seem to affect the widget display.
The page I need help with: [log in to see the link]
I’m running WordPress v6.3.1 with Woocommerce v8.1.1 and the Deli theme. I have added a Product categories widget to the sidebar, but the number of products in each category shows in the sidebar. How can I suppress this? I already have the functions.php edit to suppress the numbers on the Shop page, but it doesn’t seem to affect the widget display.
From what I understand, you’re working with WordPress v6.3.1, WooCommerce v8.1.1, and the Deli theme. You’ve successfully added a Product categories widget to your sidebar. However, you’ve encountered an issue where the product count for each category is visible, and you’d prefer to hide this. Despite attempting to modify the functions.php file to hide these numbers on the Shop page, the widget display remains unaffected.
No worries, here’s a simple solution for you. You can hide the product count in the Product categories widget by applying this CSS code:
Thanks for this, your example looks great, but it didn’t have any effect on my install. What might I have missed? Here’s a screenshot of the CSS entry.
Thanks for this, your example looks great, but it didn’t have any effect on my install. What might I have missed? Here’s a screenshot of the CSS entry.
Thank you for your response and for providing the screenshot. I see what might be causing the issue here.
In CSS, the “.” (dot) before a class name is very important as it is used to select elements with a specific class. In your case, you should be using “.wc-block-product-categories-list-item-count” instead of “wc-block-product-categories-list-item-count”.
So, please replace your current CSS code with the following:
We’re glad that we’re able to help. I’m going to mark this thread as resolved, but please don’t hesitate to start a new topic if you have any more questions down the line.