meta_query not working as expected
-
hi,
I am fetching posts with the custom field with either word_count > 1000 or number_count > 1.
Very basic query.
Code below:
$args = array(
'post_type' => 'post',
'posts_per_page' => 8,
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'word_count',
'value' => 1000,
'type' => 'NUMERIC',
'compare' => '>'
),
array(
'key' => 'number_count',
'value' => 1,
'type' => 'NUMERIC',
'compare' => '>'
),
),
);
$posts = get_posts($args); ## working as expected
$posts = get_crp_posts($args); ## fetch 0 postsget_posts() works as expected but get_crp_posts() fetches no posts, I been testing multiple times but canot fix it.
get_crp_posts() can work with only one meta_query condition but cannot handle OR relation.
Please have a look.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.