Prevent pre_get_posts filter on specific post type
Improve your conditional to include a check for post type being queried. It can be done via WP_Query::get method So, where you have if ( !is_admin() ){ $query->set( ‘meta_key’, ‘_ct_selectbox_52f65ae267764’ ); $query->set( ‘meta_value’, $city ); return; } replace with if ( ! is_admin() && in_array ( $query->get(‘post_type’), array(‘event’,’venue’) ) ) { $query->set( ‘meta_key’, ‘_ct_selectbox_52f65ae267764’ ); … Read more