how to order a dropdown by parent terms?
-
Hello,
I’m using the plugin to make a multi-dropdown taxonomies search. The first dropdown has categories with parent and child terms all showing inside this select field. I want to make child terms show under their parent terms by adding left padding. I added this code inside the foreach() in line 212 in /wp-query-search-filter.php file:
if ( 0 == $term->parent ) { $pad = ''; } else { $pad = ' '; } echo '<option value="'.$term->slug.'" '.$selected.' class="'.$class.'">'.$pad.' '.$term->name.'</option>';
this adds left space to child terms, but the problem is all parent and child terms show in the ASC order. It doesn’t show child terms inside their parent terms.
any help?
https://www.ads-software.com/extend/plugins/wp-query-search-filter/
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘how to order a dropdown by parent terms?’ is closed to new replies.