I am using the: http://www.farinspace.com/how-to-create-custom-wordpress-meta-box/ function to create some custom meta boxes.
My WP_Query looks like this:
$args = array(
'post_type' => 'testimonials',
'post_status' => 'publish',
'orderby' => checked((bool) $instance['testimonials_random'], true, false) ? 'rand' : 'id',
'posts_per_page' => $testimonials_number,
'paged' => get_query_var('page'),
'meta_query' => array(
array(
'key' => '_my_meta["addtosidebar"]',
'value' => 'on',
'compare' => 'LIKE'
)
)
);
$query = new WP_Query($args);
The input checkbox addtosidebar looks like this:
<input type="checkbox" name="_my_meta[addtosidebar]" <?php checked((bool) $meta['addtosidebar'], true); ?> class="checkbox" />
Do you have any idea how can I access the key in the meta_query?
Thanks, Cip