Can my WordPress custom templates be in the plugin folder or only in the theme folder?

Solution:1

Things are falling apart because when you move those files, you’re violating WP’s native template hierarchy. You’ll need to explicitly declare the location of those files. Using the archive as an example, you could add something like this to functions.php (to tell WP to look elsewhere):

add_filter('template_include', 'include_album_template', 1);
function include_album_template($template_path) {
if(get_post_type() == 'albums') {
    if(!is_single()) {
        $theme_file = 'path-to-your-plugin-directory';
        $template_path = $theme_file; 
    }
}
return $template_path;
}

Obviously you’d use your own path, and I wrote this hastily so you might want to refactor.

Solution:2

You can use single_template filter hook.

/* Filter the single_template with our custom function*/
add_filter('single_template', 'my_custom_template');

function my_custom_template($single) {

    global $post;

    /* Checks for single template by post type */
    if ( $post->post_type == 'POST TYPE NAME' ) {
        if ( file_exists( PLUGIN_PATH . '/Custom_File.php' ) ) {
            return PLUGIN_PATH . '/Custom_File.php';
        }
    }

    return $single;

}