Skip Navigation

[Resolved] Display and select child terms in search filter when parent term is selected

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a custom search View that includes checkbox filters for a hierarchical taxonomy. I would like to hide child terms until the parent term is checked. When the parent is checked, I would also like to automatically check the child terms.

Solution: This type of custom taxonomy filter is not currently provided by Views, and would require complex custom code.

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by Christian Cox 6 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#918284

Hi. I'm trying to display the checkboxes for taxonomy items under a single taxonomy like this website:
Select Resource Category(s): hidden link

Notice how the child taxonomy items don't show unless you click on parent.
How can we achieve this?

Currently, none of the child taxonomy items show.

#918295

Also when the user selects the parent taxonomy, it should automatically check off the child taxonomies underneath it.

#918359
Screen Shot 2018-06-27 at 10.03.18 AM.png

Hi, the taxonomy filter shown in this example isn't provided in Toolset. You may be able to create something similar using custom code and the Views API wpv_filter_query, but that type of search filter customization is not supported here in the forums.

Currently, none of the child taxonomy items show.
Is your View configured to "show only available options" in the Custom Search settings? If so, this could be why no child terms appear in the filter checkboxes. See the attached screenshot. If you cannot see the Custom Search settings in the View editor screen, scroll to the top right corner of the page and click "Screen Options". You can enable the panel here. If you are still unable to see the child terms in your taxonomy filter checkboxes, let me know and I can take a closer look.