If you want all posts that have ReleasedProject
AND PermanentArtist
both set to true, you need to change the value
keys for both of those to 'true'
. If you want to exclude all posts that have both of those set to 'false'
, you need to add 'compare' => '!='
to both meta query arrays.
EDIT
The logic behind meta queries is such that all conditions must be met (it’s an AND
relationship). So if you say
'meta_query' => array(
array(
'key' => 'ReleasedProject',
'value' => 'false'
),
array(
'key' => 'PermanentArtist',
'value' => 'false'
)
)
That means “find all posts that have both Released Project identical to 'false'
AND Permanent Artist identical to 'false'
.” If you were to add the 'compare' => '!='
statement like I mentioned earlier, it would be saying “find all posts that have both Released Project NOT identical to 'false'
AND Permanent Artist NOT identical to 'false'
.” If you have a post that has Released Project set to 'false'
and Permanent artist set to 'true'
, it will not show up in either of those queries.
Furthermore, if a meta value is missing, it will not show up in the results either. So if you have a post with Released project set to true, and permanent artist not set at all, this meta query will not find that post:
'meta_query' => array(
array(
'key' => 'ReleasedProject',
'value' => 'false',
'compare' => '!='
),
array(
'key' => 'PermanentArtist',
'value' => 'false'
'compare' => '!='
)
)
Basically, meta queries don’t do ‘either/or’ checks, they do ‘both/and’ checks when you have multiple meta queries.