Skip Navigation

[Resolved] Filter no longer work when – filter the taxonomy via a URL argument

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

Problem: I have a custom search View that allows Users to filter by taxonomy term using a front-end filter and URL parameter. If I link to the page with a URL parameter already added in the URL, the results load as expected. However, the User is not able to change the query to filter by a different term. The filter is not applied and the URL does not change.

Solution: Since it is possible to apply multiple terms from a taxonomy, the URL parameter syntax is a bit different. You should use brackets in the URL parameter syntax to indicate more than one value is possible. The HTML entities for brackets are %5B%5D, so the new URL will be:

https://your-site.fr/custom-search-page/?wpv-genre-musical%5B%5D=jazz

Without the brackets, the custom search feature will not work as expected.

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

Last updated by sergeP 5 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#1360917

Hello,

I found how to have a url argument to directly filter the view while accessing it.
https://toolset.com/documentation/user-guides/filtering-posts-by-user-selected-taxonomy/
The url displaying my view is : hidden link

So users have the possibility to directly have a filter when accessing the page with the following urls :
- hidden link
- hidden link
- ...

The problem is that if the user want to change the filter to another taxonomy, the query does not work, the url stays static and the page does not reload.

Is there a solution ?

Thank you in advance.
Best

#1360961

Hi, since it's possible to have multiple genres, you should update the URL parameter to use brackets [] before the equals sign. The HTML entities for brackets are %5B%5D, so the URLs should look like this:

<em><u>hidden link</u></em>

Then if your visitors select "rock", the URL will update automatically to show both jazz and rock selected for the musical genre:

<em><u>hidden link</u></em>
#1361413

My issue is resolved now. Thank you!