please help me create query parameters for search by title and meta,
example:
item:
1 – title: company, content: asdf, meta_field_vendor: asd
2 – title: comp, content: company, meta_field_vendor: asd
3 – title: ttcmp, content: asdf, meta_field_vendor: asd
4 – title: myrus, content: asdf, meta_field_vendor: company
my search string ?s=company
I want to search result was items: 1,2,4
This qyuery arg
$args['wp_query'] = array(
'post_type' => $post_type,
'posts_per_page' => 5,
's' => $search_s,
);
result 1 and 2
This qyuery arg
$args['wp_query'] = array(
'post_type' => $post_type,
'posts_per_page' => 5,
'meta_query' => array (
array(
'key' => '_item_prop_title',
'value' => $search_s,
'compare' => 'EXISTS'
)
)
);
result 4
how can I make a query for result 1,3,4?
$args['wp_query'] = array(
'post_type' => $post_type,
'posts_per_page' => 5,
's' => $search_s,
'meta_query' => array (
array(
'key' => '_item_prop_title',
'value' => $search_s,
'compare' => 'EXISTS'
)
)
);
Cheers!
what you could do for your problem is a dual process of search, if it is not an optimal response but if it works…
Have you tried something like?: