I'm having an issue with the "s" parameter in wp_query.
When someone search a text with two or more words, wp_query split the criteria in two or more parameters. For example :
[no_found_rows] =>
[search_terms_count] => 3
[search_terms] => Array
(
[0] => online
[1] => books
)
[search_orderby_title] => Array
(
[0] => wp_posts.post_title LIKE '%online%'
[1] => wp_posts.post_title LIKE '%books%'
)
How can I modify that behaviour in wp_query, so if I search "Online books" just use the whole text?
Thanks in advance.
I'm having an issue with the "s" parameter in wp_query.
When someone search a text with two or more words, wp_query split the criteria in two or more parameters. For example :
[no_found_rows] =>
[search_terms_count] => 3
[search_terms] => Array
(
[0] => online
[1] => books
)
[search_orderby_title] => Array
(
[0] => wp_posts.post_title LIKE '%online%'
[1] => wp_posts.post_title LIKE '%books%'
)
How can I modify that behaviour in wp_query, so if I search "Online books" just use the whole text?
Thanks in advance.
This works the same way Google etc work, to search for an exact phrase, wrap it in quotes
e.g. online books
vs "online books"