Forums › Forums › Search & Filter Pro › Custom Taxonomy 'show all' checkbox
- This topic has 4 replies, 2 voices, and was last updated 7 years, 4 months ago by
Anonymous.
-
Anonymous(Private) March 7, 2018 at 3:43 pm #164552
I have a list of terms from a custom taxonomy, with sub-cateogires listed underneath these as a checkbox. eg
Cats []
– Nice Cats []
– Mean Cats []
Dogs []
– Big Dogs []
– Little Dogs []I have stripped out the checkbox from the parent categories (‘Cats’, ‘Dogs’) and turned these into accordion drawers, so what I would like to do is have an ‘All <Parent cat name>’ option at the top of each subcat list like this.
Cats
– All Cats []
– Nice Cats []
– Mean Cats []
Dogs
– All Dogs []
– Big Dogs []
– Little Dogs []I do not see an option to achieve this anywhere and wondered if someone could point me in the right direction.
Anonymous(Private) March 8, 2018 at 11:34 am #164800I do, but I have found a solution using jQuery. I cloned the parent categories, and moved them into the .children list, wrapped them in a
<li>
, and prepended them with ‘All ‘ 🙂jQuery('.sf-level-0').each(function() { jQuery(this).find('.sf-label-checkbox:first').clone().prependTo(jQuery(this).find('.children')); jQuery(this).find('.sf-input-checkbox:first').prependTo(jQuery(this).find('.children')); jQuery(this).find(".children .sf-input-checkbox:first").next().andSelf().wrapAll('<li>').prepend('All '); });
-
AuthorPosts