Query_posts with custom field meta value
The best solution i found for querying posts where the meta_key IS NOT or doesn’t exists is to use the posts_where filter with a small sub-query, try this: //paste this function in your theme’s functions.php function metakey_no_featured( $where ) { global $wp_query; global $wpdb; $where .= $wpdb->prepare(” AND $wpdb->posts.ID NOT IN ( SELECT post_id FROM … Read more