How to hide widget in parent category only

I have a WooCommerce store with a category structure as follows:

Accessories
Accessories-Signage
Accessories-General
Accessories-Landscape

I want to hide the sidebar on the parent Accessories category page, but still have it visible for the child sub-categories.
I’ve read the documentation, tried every documented example, but still can’t get it to work.
Any pointers would be greatly appreciated!

3 Responses to How to hide widget in parent category only

  1. George July 9, 2019 at 12:19 pm #

    That’s great Steve, I’m glad you resolved it.

    Cheers

  2. Steve Scott July 8, 2019 at 3:45 pm #

    Hi George

    Yes, delighted to say that this does indeed do the job perfectly!

    My Accessories category slug is ‘accessories’ so as you suggested above, the token was simply:
    [tax:product_cat:accessories]

    I can stop banging my head on the desk now 🙄

    Many thanks
    Steve

  3. George July 8, 2019 at 2:44 pm #

    Hi Steve,

    Thanks for using our plugin.

    You can hide the sidebar only for Accessories parent category if you go to the sidebar visibility settings, add this token [tax:product_cat:accessories_category_slug] and select the option to Show on all except these pages.
    Please let me know if it does the trick.

    Kind regards,
    George

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account

Share