Custom Taxonomy 'show all' checkbox

Forums Forums Search & Filter Pro Custom Taxonomy 'show all' checkbox

Viewing 5 posts – 1 through 5 (of 5 total)
  • Anonymous
    #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.

    Trevor
    #164572

    Do you have the Include Children in Parents option checked (ON)?

    Anonymous
    #164800

    I 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 ');
    	
    });
    Trevor
    #164803

    Cool. Am I OK to close this thread?

    Anonymous
    #164805

    Yes. Thanks.

Viewing 5 posts – 1 through 5 (of 5 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.