Skip Navigation

[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.

Take a look here below for more information.
https://toolset.com/forums/topic/view-showing-all-posts-instead-of-sorting-by-designated-query/#post-1487267

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, 1 month 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by richardG-4 4 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#1487165

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.

#1487221

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Richard,

Thank you for getting in touch.

Would you mind providing me with admin access to the page to check the views on the backend to see if everything has been setup correctly ?

The private fields have been enabled for your next response.

Thanks,
Shane

#1487223

That's fine. I think I messed up submitting the form, let me try again.

#1487227

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Here are the private fields once more

#1487267

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2020-01-30 at 2.09.18 PM.png

Hi Richard,

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.

Please let me know if this helps.

Thanks,
Shane

#1487277

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.

#1487293

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Richard,

"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.

Thanks,
Shane

#1487301

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?

#1487305

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Richard,

"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.

Thanks,
Shane

#1487399

That worked, thank you for explaining

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