I was reading this post to "Exclude posts with specific meta_value" but it does not work correctly. Here is the arguments I am passing to WP_Query
:
$args=array(
'cat' => $catid,
'category__in'=> $term_ids,
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'featured_post',
'value' => 'on',
),
),
);
Using the above method, I can list posts which use meta key, but I do not want posts, with meta key "featured_post" to be displayed. If I change the value
to something else then no post is displayed.
The meta value is simply a check box for featured posts.
compare
argument for themeta_query
.