[Resolved] View showing all posts instead of sorting by designated query
This thread is resolved. Here is a description of the problem and solution.
Problem:
The issue here is that the user essentially is building a view to filter out some data. In this view they have a frontend filter and a static filter. However the frontend filter was not working.
Solution:
The reason for this was that the user had added the frontend filter as a static query filter. It is not possible to have frontend filters to filter for data when the query filter for that frontend filter is static.
In order for the frontend filters to work correctly they must be connected to a dynamic query filter which would get the filtered value from a URL parameter.
This support ticket is created 4 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.
I am trying to: Show custom posts with a specific taxonomy, in this case I have speakers for an East Conference and for West Conference. I have two Views, one for speakers in the East Conference, another for the West Conference. I also have two taxonomies to sort them by. There are some speakers that will be speaking at both.
Link to a page where the issue can be seen: hidden link and also at hidden link
I expected to see: When someone visits the East Conference page I only want the speakers for the East Conference to show up, then they can sort by the events using the drop down. The events are subcategories of the Conferences.
Instead, I got: When someone visits the East (or West) Conference page, they are currently able to see <b>all</b> of the speakers. I only want the speakers that have the East Conference taxonomy assigned to them.
Thank you for the credentials. I was able to log in and identify the issue as to why your filter isn't working.
How views work is that you can only have a Static or Dynamic filter with the frontend filters. In your case you have the East Conference view with a static filter , see screenshot .
However you have a dynamic frontend filter for the same East Events filter which won't work.
It's fine to keep the West Events filter for the East Conference view but your East Events filter must be a dynamic filter for the frontend filters to work.
I'v made the changes to the West Conference view and it should be filtering on the frontend fine now. I would suggest making similar changes to the view for the East Conference view and it should start working as well.
I don't think that worked, I can still see Aaron York on the West Conference, and he doesn't have any East or West Conference tags applied, so he probably shouldn't be showing up on either list at all, right?
I tried removing the "None of these" filter to see if that would help, but I can still see him.
When this West Conference view is working as expected the only people that would show up are presenters with a West Conference event tag applied.
"I don't think that worked, I can still see Aaron York on the West Conference, and he doesn't have any East or West Conference tags applied, so he probably shouldn't be showing up on that list at all, right?"
The reason why he shows up is because we changed the filter to the dynamic filter so the frontend filter works. This means that even though Aaron York isn't assigned to a taxonomy he will still show up. This is because none of the filters would exclude him until the search is performed.
Once a search is performed you will notice that he won't show up in any of the available options that produce a result. So the view is working as expected.
There must be some way to configure the Views, filters, and taxonomy so the Views only show relevant content before the search is performed, right? Would a static filter do that, and then I change the front end filter to something else?
"Would a static filter do that, and then I change the front end filter to something else?"
This would resolve the issue but you will need to create something else to filter the items by. It could be another taxonomy or a custom field checkbox of some sort.