Skip Navigation

[Resolved] Views / Archive Taxonomy Filters – No Option to ‘Show Only Available Options’

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

Problem:
The user would like to hide filters that are empty for the results set.

Solution:
You can customize manually to hide the filters that are empty in the view settings. http://prntscr.com/rqwglm

This support ticket is created 4 years, 8 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: Africa/Casablanca (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by jonB-5 4 years, 7 months ago.

Assisted by: Jamal.

Author
Posts
#1570715
Screenshot 2020-04-01 at 13.19.11.png
Screenshot 2020-04-01 at 13.17.19.png
Screenshot 2020-04-01 at 13.14.58.png
Screenshot 2020-04-01 at 13.14.53.png
Screenshot 2020-04-01 at 13.14.46.png

I am using taxonomy filters to filter my views.

In the front-end select field, I expect to only see taxonomy terms that have posts assigned to them.

Instead I am seeing all taxonomy terms.

All support threads I've found suggest that there is an option to 'Show only available options' when crating or editing taxonomy filters, but there is not (see attached screenshots).

This issue is the same for a WordPress Archive and for a View.

Filter code is below...

[wpv-control-post-taxonomy taxonomy="sailing-types" type="select" default_label="Sailing Types" url_param="wpv-sailing-types" class="my-1"]
#1570891

Hello and thank you for contacting the Toolset support.

On your screenshot (Screenshot 2020-04-01 at 13.19.11.png), you need to choose the last option "Let me choose individual settings manually" of "Custom Search Settings " to see the option "Show only available options for each input". Check this screenshot hidden link

I did a small test on my install, I have a custom post type "Books" and a custom taxonomy "Book Authors". And I created a search view with the taxonomy dropdown and an additional field(Is Favorite).
Depending the "Is Favorite" filter, the taxonomy dropdown shows only the taxonomy terms that have books assigned to them, check these screenshot:
Is Favorite checked: hidden link
Is Favorite unchecked: hidden link

I hope this answers your question. Let me know if you have any doubts.

#1574091

That's solved it, Thank you!