I have created a home archive where I have added a taxonomy query as set of checkboxes. But the taxonomy has a lot of terms. I want to make the terms collapsible. I don't want to use Select Multiple Or Select Dropdown option as they don't have checkboxes.
I want to add an arrow icon beside the text 'Purpose'. Users will click on that icon to reveal or hide the terms.
How can I make the set of checkboxes collapsible?
Hello,
It is possible with custom CSS/JS codes, see below sandbox website:
Login URL: hidden link
Post view with search form:
hidden link
1) Find and select the 'Purpose' taxonomy Custom Search Filter, in the block setting panel, option "CSS CLASSES", add a CSS class name: wpv-purpose, see my screenshot css-class3.jpg
2) Find and select the view block, in the block setting panel, in the "Custom CSS" option, use below CSS codes:
label[for="purpose"]::after{
content: ">";
}
.wpv-purpose span.wpv-custom-search-filter__input{
display:none;
}
in the "Custom JS" option, use below JS codes:
jQuery('label[for="purpose"]').click(function(){
jQuery('.wpv-purpose span.wpv-custom-search-filter__input').toggle();
});
See the result here:
hidden link
My issue is resolved now. Thank you!