Navigation überspringen

[Gelöst] How can I limit Custom Search result to EXACT MATCH of the custom post title?

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

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 vor 6 Jahren, 6 Monaten. 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)

Dieses Thema enthält 18 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von PaulS4783 vor 6 Jahren, 6 Monaten.

Assistiert von: Minesh.

Author
Artikel
#921703

Try this link.
versteckter Link
Is it relevant that the search results output is on a different page?

#921704

Minesh
Supporter

Sprachen: Englisch (English )

Zeitzone: 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.
versteckter Link

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