How to merge listing query to display property and land
Using the WordPress pre_get_posts filter you can alter the default post type archive page to include another listing custom post type.
function my_property_land_merged_query($query) { // Do nothing if is dashboard/admin or doing search if ( is_admin() || epl_is_search() ) return; // Show property and lang post types on the main /property/ page if ( $query->is_main_query() && is_post_type_archive( 'property' ) ) { $query->set('post_type', array( 'property', 'land' ) ); return; } } add_action( 'pre_get_posts', 'my_property_land_merged_query' , 20 );
Alternatively you can use the [listing] shortcode and specify two listing types with the post_type="property,land" options.