bundled single-property template. if ( is_singular( 'mlsimport_property' ) ) { $located = Mlsimport_Standalone_Template::locate( 'single-mlsimport-property.php' ); if ( file_exists( $located ) ) { return $located; } } // Property archive OR any of the plugin's property taxonomy archives. if ( is_post_type_archive( 'mlsimport_property' ) || is_tax( Mlsimport_Standalone_Cpt::taxonomy_slugs() ) ) { $located = Mlsimport_Standalone_Template::locate( 'archive-mlsimport-property.php' ); if ( file_exists( $located ) ) { return $located; } } // Single agent profile page -> bundled single-agent template. if ( is_singular( 'mlsimport_agent' ) ) { $located = Mlsimport_Standalone_Template::locate( 'single-mlsimport-agent.php' ); if ( file_exists( $located ) ) { return $located; } } // Agent archive (directory) -> bundled agent-archive template. if ( is_post_type_archive( 'mlsimport_agent' ) ) { $located = Mlsimport_Standalone_Template::locate( 'archive-mlsimport-agent.php' ); if ( file_exists( $located ) ) { return $located; } } // Not a standalone view (or the bundled file is missing): leave WP's choice. return $template; } }