Sauter la navigation

[Fermé] Search filter

This support ticket is created Il y a 4 années et 2 mois. 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)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Nigel Il y a 4 années et 2 mois.

Assisté par: Nigel.

Auteur
Publications
#1800079
frontend.jpg
backend.jpg

Hi there,

on the archive pages for my CPT (products) is a search with filter options.
The text search works fine, but the filter doesn't work.

In the toolset editor for the archive view, I get the following message (see screenshot):
"This filter will not be applied to Taxonomy Archives matching the filtered taxonomies: ..."

The search should fiter two taxonomies (see screenshot), like here:
lien caché

On the page you can see the text search + fiter 1 + filter 2.
Both of the filter won't work.

Where is the problem?

Regards,
Björn

#1800519

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

I suspect the problem arises because you are trying to add a filter for the same taxonomy that the custom archive is assigned to.

Let me example with a simple example, a colour taxonomy with terms like red, blue, yellow etc.

When you visit a URL such as site.com/colour/red/ then WordPress understands you want to display posts which have the term 'red' of the taxonomy 'colour' assigned.

You cannot also filter those posts by a different term, e.g. blue, because WordPress knows that this is the archive for "red" posts, it can't display "blue" posts there.

You don't have such limitations if you add a custom search View to a static page and include a filter for colours, you can search for red, then change the filter and search for blue, etc., the query is arbitrary.

But an archive is not arbitrary, it is determined by the URL (according to your permalink structure).

The simplest option is to create a search View inserted on some page, then you shouldn't encounter any problem with which filters you can use.

If you really want to use the archive URL, rather than inserting a filter for the taxonomy you could add a select dropdown which links to the other term archives, so if someone were at site.com/colour/red and chose 'blue' they would navigate to site.com/colour/blue rather than have blue results shown at the red URL. (You could generate such a dropdown using a Taxonomy View.)

If I've misunderstood the issue let me know and we can take a closer look.

Le sujet ‘[Fermé] Search filter’ est fermé à de nouvelles réponses.