I have a single checkbox with a checked value of ‘Yes’ and am trying to query posts that have that checkbox checked.
This is the code I’m using:
$args = array(
'numberposts' => 3,
'post_type' => 'resource',
'meta_key' => 'is_a_featured_resource',
'meta_value' => 'Yes'
);
$the_query = new WP_Query( $args );
However, I get no posts returned. I have verified that the posts are checked. Where did I go wrong?
Hi devprose
Try
'meta_value' => true
I think the checkbox saves the values as true / false