Can I exclude a post by meta key using pre_get_posts function?
I see many people prefer to use pre_get_posts hook instead of query_posts Yay! So pre_get_posts filters a WP_Query object which means anything you could do via query_posts() you can do via $query->set() and $query->get(). In particular we can make use of the meta_query attribute (see Codex): $meta_query = array( array( ‘key’=>’featured’, ‘value’=>’yes’, ‘compare’=>’!=’, ), ); … Read more