0
How does Wordpress search in custom fields?
I researched and saw that his search works using the title and content of the content. I created a project that uses custom fields, such as: address and phone number, with the possibility of the user to enter the city name, address, state or telephone.
The city name is the normal title, the rest of the fields are all custom.
I am using a query to do this, because I am displaying the result via ajax
$string = $_GET['string'];
$argumentos = [
'post_type' => 'unidade',
'posts_per_page' => -1,
's' => $string
];
$posts = new WP_Query($argumentos);
?>
What exactly is the question? What do you intend to do?
– João Martins
Let wordpress perform the search in custom fields as well
– Sérgio Machado
Put your query to the question
– lazyFox
@lazyFox placed is very simple
– Sérgio Machado
I’m not familiar with
Wordpress
but while waiting for an answer see this link– lazyFox