How to modify the Loop from a plugin (instead of a theme)
for a simple meta query you can do this: function wpa_47150( &$query ) { if(!is_admin()){ set_query_var(‘meta_key’, ‘test_field’); set_query_var(‘meta_value’,’bacon’); } } add_action(‘pre_get_posts’,’wpa_47150′); i wasn’t sure it was going to work, but apparently you can set the whole meta_query object this way too function wpa_47150( &$query ) { if(!is_admin() && is_post_type_archive( ‘test_post_type’ )){ $metaq = ( array … Read more