Sauter la navigation

[Résolu] How can I limit Custom Search result to EXACT MATCH of the custom post title?

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
How can I limit Custom Search result to EXACT MATCH of the custom post title?

Solution:
To search by exact title you need to override the query arguments yo u need to use the WordPress 'posts_search' hook.

You can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/how-can-i-limit-custom-search-result-to-exact-match-of-the-custom-post-title/#post-921659

Relevant Documentation:

This support ticket is created Il y a 6 années et 7 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

Ce sujet contient 18 réponses, a 2 voix.

Dernière mise à jour par PaulS4783 Il y a 6 années et 7 mois.

Assisté par: Minesh.

Auteur
Publications
#921703

Try this link.
lien caché
Is it relevant that the search results output is on a different page?

#921704

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

You should have mentioned that first. YES - thats why the problem occurs.

Please try following code:

[wpv-conditional if="( '[wpv-search-term param='wpv_post_search']' eq '' ) AND ( '[wpv-search-term param='wpv_filter_submit']' ne '' )"]
 [wpml-string context="wpv-views"]You must enter a search code.[/wpml-string]
[/wpv-conditional]

Now - it must be FIXED 🙂 - waiting for your confirmation 🙂

#921706

Bingo!
Fantastic work.

Thanks for all your support on this.
I don't think I would have solved it alone.

You can close the ticket. 😉

#948973
shot3.png
shot2.png
shot1.png

I need to open this ticket again.

There is a problem with the query when used on a WPML site.
As per my original post, I DON'T want to show any records unless there is an exact match for the shipping code.

HOWEVER, in it's current form, the filter can be circumvented by "toggling" between language versions.
lien caché

Is it necessary to duplicate the view and use a different view code for each language version?
Seems a bit redundant if it is.