Skip Navigation

[Resolved] Archive Blocks’ Search filters display options that would not produce results

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

Problem: I have a custom search WP Archive for a taxonomy that uses custom search. I have set the search feature to display only those options that would produce results. If I select one option, the options update as expected, but when the page loads all options are displayed. I have included other Views on the page.

Solution: In this case, it seems that omitting the filters from other Views included on the page is responsible for producing the problem in the archive filters. The filters were omitted by removing the wpv-filter-meta-html shortcode in the Output Editor. Replace the filter shortcode in the Output Editor of the other Views to solve the problem:

[wpv-filter-meta-html]
This support ticket is created 2 years, 10 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 5 replies, has 2 voices.

Last updated by umbertoZ 2 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#2078321

Hi, I built a taxonomy archive page with Blocks. I've activated the Search option with "AJAX refresh when changing any filter" and "Show only filter options that would produce results".

The problem is that the last setting is not working fine. The filters are displaying all the options, including options that would not produce results.

This is an example on the front page:
/bizkaia/

This is the Archive:
/wp-admin/post.php?post=35&action=edit

In the archive you will find the Archive loop with the search bar and a Google Map that displays markers coming from another view loop, not from the Archive loop.

cheers

#2078577

Hello, there were some problems with the "show only filter options that would produce results" custom search feature in Blocks 1.5.2, but Blocks 1.5.3 included updates that should have resolved those problems - https://toolset.com/errata/view-setting-show-only-filter-options-that-would-produce-results-not-working-correctly/. It is possible that some edge cases or scenarios were not completely fixed in the latest update. It could also be the result of a conflict with another plugin, or a conflict with custom code in your theme or code snippets. I can see that your site uses a 3rd-party plugin to remove the taxonomy base slug from archive URLs. I can see you also have similar custom post types and taxonomies called "Provincia" or "Provincias". Since the problem occurs in a Provincias taxonomy archive, I wonder if either of those circumstances is causing or contributing to the issue with filter options. As a test, can you try these troubleshooting steps first to rule out conflicts?
- Temporarily activate the parent Astra theme
- Temporarily deactivate all custom code snippets in Toolset > Settings > Custom Code
- Temporarily deactivate all plugins except Types and Blocks
- Test the archive again, and note that the URL of the archive may have changed since disabled the plugin to remove the taxonomy base slug from the archive URLs
- If the problem is resolved, reactivate the theme, custom code snippets, and other plugins one-by-one until the problem returns
- If the problem is not resolved, I may need to make a copy of the site to run some more tests Please let me know if that is the case, and I can make a site clone.

Please let me know the results of his test and if I can make a site clone.

#2079121

Hi Christian, I've followed the troubleshooting steps: I've activated default theme, I've deactivated all the plugins but Toolset, I've deactivated custom code, I've re-saved permalinks and I still got the problem.

You can make the local clone.

cheers

#2079513

Thanks, I created a site clone and installed it locally. If I delete the Content Template above the custom search filters, the problem seems to be resolved. The issue could be related to a conflict with one of the other Views included in the Cabacera - Archive Content Template. I am still investigating and will give you another update shortly.

#2079543

Okay I was able to solve this in my local copy by editing this View, which is included in the Cabacera - Archive template:
/wp-admin/admin.php?page=views-editor&view_id=2550

I added the filters shortcode back to the Output Editor panel:

[wpv-filter-meta-html]

It seems that without the filters section in this View, the system has trouble implementing the feature that only shows the filter options that produce results in the WP Archive search filters. There are no front-end filters included in this View anyway, and the option to disable the wrapping div is checked, so adding the filter meta shortcode has no impact on the front-end of the site as far as I can tell, other than solving the problem in the WP Archive filter options.

I made this change in the live site and it seems to be showing the appropriate filter options now, can you confirm?

#2079745

Yes!! My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.