I would like to search in custom_postcustom_post
by title and by the ACF fields.
So, iI used the WP_Query WordpressWP_Query
WordPress function but iI can't filter by the title, just by the filters.
When I submit my form, iI have this kind of URL: http://site.com/?s=titre&filter1=condition1&filter2=condition2&filter3=condition3
http://example.com/?s=titre&filter1=condition1&filter2=condition2&filter3=condition3
My code:
$title = $_GET['s'];
$args = array(
'pagename' => $title,
'numberposts' => -1,
'post_type' => 'my_custom_post',
'meta_query' => array(
array(
'key' => 'filter_1',
'value' => $_GET['condition_1']
),
array(
'key' => 'filter_2',
'value' => $_GET['condition_2']
),
array(
'key' => 'filter_3',
'value' => $_GET['condition_3']
)
)
);
$the_query = new WP_Query($args);
Do you have any ideasidea to include the title in the search ?
Thank you !