Query Multiple Taxonomies
Is there a way to hide the children term's of each parent t (5 posts)

  1. AndrewMunro
    Posted 4 years ago #

    I have a taxonomy of "age", with parent terms of as age groups (18-25) and child terms (18,19,20,21,22,23,24,25) within each age group parent. I figured this would be a good way to have some sort of age range.

    In the actual dropdown that is displayed on the front-end, is there a way I could hide the children so it only displays the parent terms? So I only see 18-25.

    I tried using CSS to hide the level-1 class but it doesn't work so great with webkit browsers. Any have any ideas? thanks!


  2. AndrewMunro
    Posted 4 years ago #

    Hmm, perhaps a walker? I have no clue how to write one, but just reading through your code in walkers.php suggests this would be a possible solution. I'd need to just modify the "age" taxonomy somehow and remove the children from the dropdown.

  3. Alessandro Cardinali
    Posted 4 years ago #

    I am very interested in resolving this issue.
    How can I hide the children term's when they are not active?

  4. Alessandro Cardinali
    Posted 4 years ago #

    Ok ... I found a solution ... perhaps rudimentary but it works:)
    I edited the file "list-item.html" inside the folder "templates":

    <li class="term-item {{#is-selected}}current-term{{/is-selected}}">
    		<a class="remove-term" href="{{url}}" title="{{title}}">{{term-name}} ({{count}}) -</a>
    		<a class="add-term" href="{{url}}" title="{{title}}">{{term-name}} ({{count}}) +</a>
    	{{#is-selected}} <!-- Mod -->
    	{{/is-selected}} <!-- /Mod -->
  5. lydiamunoz
    Posted 4 years ago #

    And do you know how can i hide the children terms if i am using dropdowns?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Query Multiple Taxonomies
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic