Support » Fixing WordPress » Retrieve Custom Fields in custom Query?
5 years, 2 months ago
I’m following this tutorial:
to create a checkbox group in a meta box.
The box is created, data is getting saved, custom sorts/filters working, etc…
But what I can’t for the life of me figure out, is how to go about creating a query with the custom fields.
My end goal is to create an archive page of posts that have a checkmark in the checkmark group.
This is what I have right now — where have I strayed?
$args = array (
'post_type' => 'post',
'meta_query' => array (
'key' => 'my_checkbox_group',
'value' => 'my_checkbox_value',
$query = new WP_Query($args);
When I do print_r($query), there are no posts found for this query (and I verifed that I have several posts with “my_checkbox_value” checked…