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!


Comments

3 responses to “How to hide widget in parent category only”

  1. George Avatar

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

    Cheers

  2. Steve Scott Avatar
    Steve Scott

    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 Avatar

    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

Share