I'm trying to use some conditional logic to compare custom fields in my query, but a bit stuck. How would I get all posts with ReleasedProject AND PermanentArtist set to 'true'?
Here's what I have so far, I'm assuming it's something to do with 'compare':
Thanks
osu
EDIT: To clarify what I want to do - I'm trying to exclude pages that have two custom field values (ReleasedProject and PermanentArtist in this case) set to 'false'. These are set through checkboxes generated using the plugin Custom Field Template.
I've updated the code to illustrate that I need to filter out all pages with these two custom fields set to false:
global $post;
$artist_args = array(
'post_type' => 'page',
'post_parent' => $post->ID,
'posts_per_page' => -1,
'orderby' => 'name',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'ReleasedProject',
'value' => 'false'
),
array(
'key' => 'PermanentArtist',
'value' => 'false'
)
)
);
$my_query = new WP_Query($artist_args);
print_r($my_query)
to see if anything is returned? Try doing this withoutmeta_query
and see if any pages are returned...'post_type' => 'page',
. You are aware you have this set to page and not postReleasedProject
ANDPermanentArtist
set totrue
. Now you want to exclude posts that haveReleasedProject
ANDPermanentArtist
set tofalse
. They are completly different logic... So which one do you want?