I make a custom search box and let user do search. I have added required field to my editing panel by custom meta box. I have a post which have some meta data like London as place and 13021 as post code. I want result when
kawsar_pa_place = london and
kawsar_pa_pc = 13021. For that cause, i use
'relation' => 'AND'. But i got 0 result found.
I made query by following argument:
$args = array( 'cat'=> '3', 'posts_per_page' => '4', 'orderby' => 'rand', 'paged' => $paged, 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'kawsar_pa_place', 'value' => 'dhaka' ), array( 'key' => 'kawsar_pa_pc', 'value' => '1362', 'type' => 'numeric', 'compare' => '=' ) ) );
If i set
'relation' => 'OR', it is working fine. But i want result if all are matched.
I also tested with
BETWEEN, it also work fine.
Please help me. Thanks.