Title: Toggle-able child categories?
Last modified: September 16, 2021

---

# Toggle-able child categories?

 *  [elyasylum](https://wordpress.org/support/users/elyasylum/)
 * (@elyasylum)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/toggle-able-child-categories/)
 * Hi there.
 * I saw the solution you had posted for this here: [https://wordpress.org/support/topic/hide-child-categories-2/](https://wordpress.org/support/topic/hide-child-categories-2/)
 * Sadly, when I tried to use the code on my own site, it didn’t work. Any tips?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ftoggle-able-child-categories%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [themifyme](https://wordpress.org/support/users/themifyme/)
 * (@themifyme)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/toggle-able-child-categories/#post-14880088)
 * Hi,
 * You have 2 levels of sub-menus, the code affects the second-level and it works
   for that, please see screen-recording: [https://share.getcloudapp.com/E0ujeeok](https://share.getcloudapp.com/E0ujeeok)
 *  Thread Starter [elyasylum](https://wordpress.org/support/users/elyasylum/)
 * (@elyasylum)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/toggle-able-child-categories/#post-14880299)
 * Hi!
 * That doesn’t happen on my end, for some reason. Anyway, I changed the code to
   this:
 * `.wpf_items_wrapper .wpf_item .wpf_submenu {
    display:none; } .wpf_items_wrapper.
   wpf_item .wpf_submenu input[type=”checkbox”]:checked + label + .wpf_submenu{ 
   display:block; }
 * And it now hides the first sub-menu like I wanted, but it still doesn’t show 
   again, when I click the sub-menu.
 * See video:
 *  Plugin Author [themifyme](https://wordpress.org/support/users/themifyme/)
 * (@themifyme)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/toggle-able-child-categories/#post-14883681)
 * Hi,
 * If you want to hide both first and second level sub-categories, please use this
   Custom CSS instead:
 *     ```
       .wpf_items_wrapper .wpf_item .wpf_submenu ul {
       display:none;
       }
       .wpf_items_wrapper .wpf_item .wpf_submenu input[type=”checkbox”]:checked + label + .wpf_submenu {
       display:block;
       }
   
       .wpf_items_wrapper .wpf_item .wpf_submenu {
       display:none;
       }
   
       .wpf_items_wrapper .wpf_item input:checked + label + .wpf_submenu {
       display: block;
       }
       ```
   
 * Please let me know how it works.
 *  Thread Starter [elyasylum](https://wordpress.org/support/users/elyasylum/)
 * (@elyasylum)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/toggle-able-child-categories/#post-14884094)
 * Hi there!
 * Added the code and now the filter hides and shows category labels as wanted. 
   However, the shop doesn’t adjust after it.
 * For instance. If I select Lyd > Høytaler > Soundbar it still just shows the shop
   front page and doesn’t actually filter.
 *  Thread Starter [elyasylum](https://wordpress.org/support/users/elyasylum/)
 * (@elyasylum)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/toggle-able-child-categories/#post-14896855)
 * I think it was a problem with all my products only having one category set each
   and the filter set to “or” instead of “and”. Testing it now.
 *  Thread Starter [elyasylum](https://wordpress.org/support/users/elyasylum/)
 * (@elyasylum)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/toggle-able-child-categories/#post-14896902)
 * Ok, now it works. New problem, though! 😀
 * If someone checks Lyd->Høytaler->Subwoofer but then unchecks Høytaler, without
   unchecking Subwoofer, subwoofer is hidden, yet still checked. Customers might
   find this confusing. Is there a way to make unchecking a parent category automatically
   uncheck all child categories?
 *  Plugin Author [themifyme](https://wordpress.org/support/users/themifyme/)
 * (@themifyme)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/toggle-able-child-categories/#post-14918350)
 * Hi,
 * Since all items are checked individually, then the same goes when you uncheck
   them, so you should uncheck everything individually, it is not possible to remove
   a different checkbox if its’ parent has been unchecked.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Toggle-able child categories?’ is closed to new replies.

 * ![](https://ps.w.org/themify-wc-product-filter/assets/icon-128x128.png?rev=1535808)
 * [Themify - WooCommerce Product Filter](https://wordpress.org/plugins/themify-wc-product-filter/)
 * [Support Threads](https://wordpress.org/support/plugin/themify-wc-product-filter/)
 * [Active Topics](https://wordpress.org/support/plugin/themify-wc-product-filter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/themify-wc-product-filter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/themify-wc-product-filter/reviews/)

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [child](https://wordpress.org/support/topic-tag/child/)
 * [toggle](https://wordpress.org/support/topic-tag/toggle/)

 * 7 replies
 * 2 participants
 * Last reply from: [themifyme](https://wordpress.org/support/users/themifyme/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/toggle-able-child-categories/#post-14918350)
 * Status: not resolved