Replies: 0
Hello,
Greetings!!
I want to use multiple meta query with or relation for more than two conditions like below example:
$query_args[‘meta_query’] = array(
‘relation’ => ‘OR’,
array(
‘relation’ => ‘AND’,
array(
‘key’ => ‘_job_tags1’,
‘value’ => $tagId,
‘compare’ => ‘LIKE’
),
array(
‘key’ => ‘_job_category1’,
‘value’ => $values_serialized,
‘compare’ => ‘LIKE’
)
),
array(
‘relation’ => ‘AND’, // make sure only this key exists by matching parameters
array(
‘key’ => ‘_job_tags2’,
‘value’ => $tagId,
‘compare’ => ‘LIKE’
),
array(
‘key’ => ‘_job_category2’,
‘value’ => $values_serialized,
‘compare’ => ‘LIKE’
)
),
array(
‘relation’ => ‘AND’, // make sure only this key exists by matching parameters
array(
‘key’ => ‘_job_tags3’,
‘value’ => $tagId,
‘compare’ => ‘LIKE’
),
array(
‘key’ => ‘_job_category3’,
‘value’ => $values_serialized,
‘compare’ => ‘LIKE’
)
)
);
this above query is not working for me. Anyone can help me?
Thanks in advance!!
Regards,
Pranjali P.