I'm currently using this to filter out only posts that have a specific custom image attachment field value. But it's returning 0. I used this method for other custom fields and it worked great. Is there something I need to do differently to get attachment images?
$args = array( 'post_type' => 'speakers', 'post_status' => array('publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit'), 'post_per_page' => -1, 'meta_key' => 'speaker_promo_image', 'meta_query' => array( array( 'key' => 'speaker_promo_image', 'value' => '', 'compare' => '!=', ) ) ); // The Query $posts = new WP_Query( $args ); $the_count = $posts->post_count;