Skip Navigation

[Resolved] filters not working

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

Supporter timezone: Africa/Casablanca (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by Jamal 3 years, 5 months ago.

Assisted by: Jamal.

Author
Posts
#1797841

hello, I have created a view with filters here: hidden link

I have displayed it on the front end here: hidden link

For some reason, whenever any filter is used, it always displays "no results", and i can't figure out why. could you help with this?

you will need to log in, TO DO SO CLICK HERE: hidden link

#1797877

for some further clarification: the view itself seems to work, and is tested here on the front end: hidden link

but i want it to display in the archive, so i use the work around method mentioned to me here: https://toolset.com/forums/topic/using-a-view-in-an-archive/

if i render the view on a simple page, it works. but if it put it in the archive it doesn work.

also, out of curiosity, why does the query include aux_current_post_id=2474&wpv_aux_parent_post_id=768

#1798801

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Hello and thank you for contacting the Toolset support.

As soon as there is an URL parameter on the archive page, no results are returned, even if no filters are selected. Check this example hidden link
And a screenshot here hidden link

Regarding this part of the URL aux_current_post_id=2474&wpv_aux_parent_post_id=768
768 is the ID of the current archive page. I believe that the view tries to get the ID of the page where it is shown. But it is an archive page, which does not have an ID. But the archive template does have the ID 768.
2474 is the ID of a post. You can edit it here hidden link
I believe that this is the first object returned by the archive. But I am not sure.

I do not believe that using a view inside an archive template instead of the archive itself is a good solution. I would suggest disabling the archive on the custom post type. Then change the slug of the page where the view works to the custom post type slug(which is the archive URL). That way, you can use a view for a page that has the same URL as the "default archive for the custom post type".

I might discuss this with my colleague Christian next week and see what he thinks about this workaround instead and what he can say about his.

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