I have the following query
, where the conditions are informed from a array
:
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC',
'ignore_sticky_posts' => true,
'category_name' => $atts['category_name'],
'posts_per_page' => ($atts['number'] > 0) ? $atts['number'] :
get_option('posts_per_page')
);
$meta_query[] = array(
'key' => '_featured',
'value' => 'yes'
);
$args['meta_query'] = $meta_query;
$the_query = new WP_Query($args);
This query
brings me the posts
which is marked as Featured
.
But what I need is the reverse, I need the posts
that are not Featured
.
If I only put 'no'
instead of 'yes'
, in this snippet:
'key' => '_featured',
'value' => 'yes'
It only returns me the posts
that once were featured
. But those who never were, do not appear, because they do not even have meta_key featured
.
The easiest thing in my view would be to bring the% posts
from "featured = yes"
, but I do not know how to do it.