Hi @Rob:
The reason you can’t figure out how to do it is because it’s not possible, at least not without resorting to SQL. Try adding the following to your theme’s functions.php
file:
add_filter('posts_where','yoursite_posts_where',10,2);
function yoursite_posts_where($where,$query) {
global $wpdb;
$new_where = " TRIM(IFNULL({$wpdb->postmeta}.meta_value,''))<>'' ";
if (empty($where))
$where = $new_where;
else
$where = "{$where} AND {$new_where}";
return $where;
}
If you have custom 'featured_image'
fields with empty values the above will filter them out. If you problem is something else, we’ll have to see what your data looks like to solve it.
One thing I’m curious about; how did you get empty values for 'featured_image'
? The admin UI in WordPress 3.1 does its best to keep you from entering empty values.
Hope this helps.