Exclude listing types from location taxonomy
Using the WordPress pre_get_posts filter you can alter the default taxonomy results to only display location profiles custom post types.
function my_exclude_listing_types_from_location_query($query) { // Do nothing if is dashboard/admin or doing search if ( is_admin() || epl_is_search() ) return; // Only show location profiles on the location taxonomy if ( $query->is_main_query() && is_tax( 'location' ) ) { $query->set('post_type', array( 'location_profile' ) ); return; } } add_action( 'pre_get_posts', 'my_exclude_listing_types_from_location_query' , 20 );
Alternatively you can use the [location_profile] shortcode and specify the location options.