Forums › Forums › Search & Filter Pro › Hide child taxomony in Hierarchical
Tagged: product category, taxomony, woocommerce
- This topic has 1 reply, 2 voices, and was last updated 9 years, 7 months ago by Anonymous.
-
Anonymous(Private) April 23, 2015 at 2:48 am #15709
Hi Jay,
I had the same need and was only able to solve it by hacking the plugin slightly in order to move the inputs to *before* the labels – the plugin by default ‘wraps’ the inputs with the label tag, because this is now considered semantically correct and more desirable for most styling purposes, however it leaves you unable to use the checked/unchecked state to hide/show child inputs.
I don’t recommend doing this unless you’re very familiar with code-hacking, and if you decide to you should be sure to back up the file just in case you have to revert, but the file I modified is in the plugin’s /public/includes/ folder named class-search-filter-taxonomy-walker.php.
After the labels are modified to follow the inputs instead of wrapping them, you’ll still need to modify your CSS file to have the labels appear inline with the checkboxes, and then to do the show/hide based on the checked/unchecked state of the parent taxonomy…..here is what I added to my own CSS file:
form.searchandfilter li label {display:inline;}
form.searchandfilter li ul li ul li {font-size:80%;}
form.searchandfilter ul.children { display: none; }
form.searchandfilter input:checked ~ ul.children {display: block;border-bottom:1px solid #ccc;}I did mention this to Ross and he may consider making this an option in a future release (wrapping the inputs inside the label tags or not). I hope this helps!
-
AuthorPosts