Use the filter template_include
to override a template path. Example:
add_filter( 'template_include', function( $template ) {
if ( ! is_singular() ) {
return $template;
}
if ( 'project' !== get_post_type() ) {
return $template;
}
// Now we can safefely
return get_stylesheet_directory() . '/single-project.php';
});