If I’m not missing something, the below should work for you. It is pretty much straight from the Codex: WP_Query – Custom Field Parameters. Do it like this:
$args = array(
'post_type' => 'post',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'color',
'value' => 'red',
'compare' => '='
),
array(
'key' => 'size',
'compare' => 'EXISTS'
)
)
);
$query = new WP_Query( $args );
Additional resources on here:
- Meta_query compare operator explanation
- Query posts only with featured image
- there are more, just use the search