hello friends this is my args for WP_Query.
$args = array(\'post_type\' => \'job_listing\');
$args[\'meta_query\']=array(
\'relation\' => \'OR\',
For the OR Query argument array should be like this:
$args = array(
'post_type' => 'post',
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'app_trailer-type',
'value' => $job_tailor,
'compare' => 'LIKE'
),
array(
'key' => 'app_pay-type',
'value' => $app_pay_type,
'compare' => 'LIKE'
),
array(
'key' => 'geo_address',
'value' => $geo_address,
'compare' => 'LIKE'
),
array(
'key' => 'geo_country',
'value' => $geo_country,
'compare' => 'LIKE'
),
array(
'key' => 'geo_short_address',
'value' => $geo_short_address,
'compare' => 'LIKE'
),
)
);
Reference: http://codex.wordpress.org/Class_Reference/WP_Query
From the WP_Query Class Reference (link):
Important Note: tax_query takes an array of tax query arguments arrays (it takes an array of arrays) - you can see this in the second example below. This construct allows you to query multiple taxonomies by using the relation parameter in the first (outer) array to describe the boolean relationship between the taxonomy queries.
You should add an array('relation' => 'OR')
to the beginning of your meta_query array.
changed args with like.
$args = array('post_type' => 'job_listing', 'relation' => 'OR');
$args['meta_query']=array(
array(
'key' => 'app_trailer-type',
'value' => $job_tailor,
'compare' => 'LIKE'
),
array(
'key' => 'app_pay-type',
'value' => $app_pay_type,
'compare' => 'LIKE'
),
array(
'key' => 'geo_address',
'value' => $geo_address,
'compare' => 'LIKE'
),
array(
'key' => 'geo_country',
'value' => $geo_country,
'compare' => 'LIKE'
),
array(
'key' => 'geo_short_address',
'value' => $geo_short_address,
'compare' => 'LIKE'
),
);
You may try something like this
$args = array(
'post_type' => 'job_listing',
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'app_trailer-type',
'value' => $job_tailor,
'compare' => 'LIKE'
),
array(
'key' => 'app_pay-type',
'value' => $app_pay_type,
'compare' => 'LIKE'
),
// ....
)
);
Read more on Codex.