Skip Navigation

[Resolved] View filter showing all results regardless of what search parameter is entered

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

Problem: I have a custom search View set up with several filter controls. I would like to require at least one of these filters to be selected in order to show results in the View. I added some code using wpv_filter_query_post_process that was in place on another site, but it seems that none of the filters work.

Solution: Check the Query Filter section of the View editor to ensure that your filters are configured correctly.

This support ticket is created 6 years, 6 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 4 replies, has 2 voices.

Last updated by Joe H. 6 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#910820

On this thread Christian Cox helped me troubleshoot my View search results:
https://toolset.com/forums/topic/troubleshoot-wpv_filter_query-in-functions-php/

It works fine, and now I am attempting to re-create this same View on a different site. The problem is that no matter what options are chosen in the filter on the new site, all results are displayed.

So I am not sure what I am doing wrong. I have updated the code in functions.php to point to the new View.

The View can be seen here:
hidden link Choose first one and then another filter option and note how the results are always the same.

I can upload the xml of the View or provide credentials in a private post

#910825

Hi, the first thing I noticed is that there are 3 JavaScript errors in the browser console on this page. Those may need to be fixed, but we can try a couple of other troubleshooting steps first:
- Modify the settings so that Views update the URL when performing searches. Go to Toolset > Settings > Frontend Content > Browser History Management and check both checkboxes. Test again.
- Temporarily deactivate all plugins except Types and Views. Test again.
- Make sure the custom field slugs on the new and old site use identical slugs
- Take a picture of the Content Selection and Query Filter sections of the View editor screen and attach it here for me to review.

#910845
Screenshot_6.jpg
Screenshot_5.jpg

Thank you for the fast response.

1. I too noticed the 3 JS errors and determined they are not being caused by Toolset. When I deactivate TS they remain, and can be removed when I eliminate other elements/plugins on the page.
2. I checked both boxes and re-tested but no change.
3. deactivated all plugins and no change
4. slugs are same because they are coming from the same plugin (this plugin uses an API to pull CPT data from our CMS)
5. screenshots attached

#910849

I'm not able to see the Query Filter section, so it may be deactivated in your admin screen settings. Please scroll to the top right of the editor screen and click "Screen Options", then enable the Query Filter section and take a screenshot showing the Query Filter configurations for me to review.

#910852

My apologies. I had forgotten about setting the query filters when re-setting up my View in this 2nd site. Your question solved my issue. Thank you again.