Skip Navigation

[Resolved] Filtering option not working

This support ticket is created 5 years, 3 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 8 replies, has 3 voices.

Last updated by kerimF 5 years, 3 months ago.

Assisted by: Nigel.

Author
Posts
#1369647

Hi there!

I have a problem with 2 views. It seems like the filtering option isn't working. At the page: hidden link, you can filter the results using "Locaties" and "Categorieen". The other problem is on the page "hidden link". On it, the "categorie" filtering option seems to be broken as well.

I'm not seeing where it goes wrong. Can you please help me?

Greetings,

Kerim

#1369693

It's a PHP fatal error os similar, I can see there are 2 JS errors pointing to such issues.

Failed to load resource: the server responded with a status of 404 ()

Could you activate WP Debug and let us know if you see any error?
Also I would suggest testing without other plugins but Toolset, and eventually, with a native WordPress theme like Twenty Nineteen.

I have also activated a private reply for providing a duplicate, in case after above steps no further improvement is seen.
You can see here how to provide a duplicate https://toolset.com/faq/provide-supporters-copy-site/

Thank you!

#1369907

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2019-10-25 at 11.44.37.png

Hi Kerim

The problem is that the when editing the Views the Query Filters which are automatically added when you insert a search filter control have been deleted, as you can see in the screenshot.

If you click on the filter control shortcodes (e.g. wpv-control-post-taxonomy) and then press the Edit Filter button to update them, it will re-insert the Query Filters.

#1369993
toolset1..PNG

Thanks for the answer. However, when I add the query filter, only one item is shown, while other items also meet the right criteria to be found. The live view is on: .hidden link. Can you tell me what I'm doing wrong and what I can do to display every post within the post type I'm trying to display?

#1370021

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Again, you have manually edited the Query Filters.

When creating a custom search View this section is normally hidden (you have to go to the Screen Options tab to expose it), because inserting the filter controls in the Search and Pagination section will automatically add the correct Query Filter.

The Query Filters you have added are hard-coded but should depend on the URL parameters generated by your filter controls.

Edit the filter controls again, as I described in the last reply, and let Views automatically generate the Query Filters. Don't change them unless you have a very good reason to.

#1370127

So I tried what you said but it's not working. I'm getting a debug window. What I did:

1. I deleted the Query filter.
2. I edited the filter controls, as you described in the previous reply

After, I saw that the query filters were back again. However, I'm still only seeing one post :(. What am I doing wrong here?

#1370133

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2019-10-25 at 15.42.04.png

Sorry, I've turned off the debug mode (you can activate it at Toolset > Settings > Front-end content).

You are ordering your View results by a custom field (see screenshot).

The way that ordering works in WordPress is that only posts that have some value for the ordering field are included in the results. So if you only see one result without applying any filters, it is almost certainly because only that one post has a value for the custom field specified.

In fact, that's easy enough to test. I just changed the order by option to order by the post date, and sure enough, all of the results are now visible.

#1370151

Aaaah, that explains it. Now it makes total sense! Thanks a lot!

#1370153

My issue is resolved now. Thank you!