Skip Navigation

[Resolved] Term Filter Showing all Terms

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

Problem:

Selecting the "Show only filter options that would produce the results" does not work and show all the results.

Solution:

At the moment you can add the Javascript code below to fix the issue:

jQuery(document).ready(function(){
  jQuery('.js-wpv-reset-trigger').trigger('click');
});

Add the code to the "WordPress Archive" block "Custom JS" option.

This support ticket is created 3 years, 4 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.

This topic contains 3 replies, has 2 voices.

Last updated by ahmedO-2 3 years, 4 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2280183
Screen Shot 2022-01-31 at 2.43.36 PM.png

I have a taxonomy with over 1000 terms and I only want to display the terms in the dropdown that will produce results on the post archive page. I have set it to show only terms that would produce results, but it's not working correctly. On initial page load it displays all the terms, a very long list. If I click on the Clear Filters link or select a term, then it filters the results and shows only the terms that would produce results. A much shorter list of about 20 terms.

I want the filter to only display terms that would produce results on page load, not after filtering.

#2281869

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

It seems that you have the same problem as the reported issue below:

https://toolset.com/errata/setting-show-only-filter-options-that-would-produce-results-doesnt-work-correctly-for-taxonomy-filters/

Our team is aware of the issue and doing its best to find a solution.

I found out that as a temporary solution you can add the Javasxript code below to the "WordPress Archive" block "Custom JS" option and it fixes the issue:

jQuery(document).ready(function(){
  jQuery('.js-wpv-reset-trigger').trigger('click');
});

I tested that and it worked here:

hidden link

You can add the same code to the other page and see if it works for you.

Kindly consider that the workaround I gave is not a solution and just a temporary thing to the best of my knowledge.

Thanks.

#2282033

Ok, thank you. I will try that.

#2282035

My issue is resolved now. Thank you!