Saltar navegación

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

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

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 hace 6 años, 6 meses. 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)

Este tema contiene 18 respuestas, tiene 2 mensajes.

Última actualización por PaulS4783 hace 6 años, 6 meses.

Asistido por: Minesh.

Autor
Mensajes
#921703

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

#921704

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: 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.
enlace oculto

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