Skip Navigation

[Resolved] Add “ALL” on taxonomy filter

This thread is resolved. Here is a description of the problem and solution.

Problem:

How can I add "ALL" option on taxonomy filter?

Solution:

In Shortcode [wpv-control-post-taxonomy] in the custom search form,
There is a attribute "default_label":
Add default option like All or Any on taxonomy select control.

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control-post-taxonomy

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by randallH-3 5 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1181301

How can I add "ALL" option on taxonomy filter?

For example I have 3 filters, then I want the 2 filters to show "ALL"

#1181346

Hello,

I assume we are talking about shortcode [wpv-control-post-taxonomy] in the custom search form:
See our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control-post-taxonomy
There is a attribute "default_label":
'default option text'
Add default option like All or Any on taxonomy select control.

You can setup it within Views UI, for example, edit your post view, in section "Search and Pagination", edit your taxonomy filter field, there is an option "Label for the first 'default' option", see screenshot default-lable.JPG

But this option is only available for single choice options: "Select dropdown" and Radios, it won't work for multiple choice options:
Checkboxes and "Select multiple"

#1183349

Is it possible to add none on the filters?

I have 3 taxonomy filters on the same page. How can they use only 1 or 2 filters without selecting also the 3rd?

#1183361

For your new questions:

Q1) Is it possible to add none on the filters?
You can add a term "None" in your custom taxonomy, but don't assign any post to term "none", so if user select option "None" in taxonomy field of custom search form, Views will output empty result.

Q2) How can they use only 1 or 2 filters without selecting also the 3rd?
If the only use 1 or 2 filters, and without selecting also the 3rd (choose "Alll" default option in 3rd), this should be able to work as you expected without any problem.

#1187791

My issue is resolved now. Thank you!