wordpress 3.4 template files in subdirectories

i’ve been organizing my sites template files into a sub directory, which is now possible with wordpress 3.4. but when i move a custom post-type single file (ie. single-news.php) into the sub directory, it is not recognized. anybody have any experience with this new feature?

Solutions Collecting From Web of "wordpress 3.4 template files in subdirectories"

The solution shared in this answer on StackOverflow works for me:


function get_book_post_type_template($single_template) {
    global $post;

    if ($post->post_type == 'books') {
        $single_template = dirname( __FILE__ ) . '/themefiles/single-books.php';
    return $single_template;

add_filter( "single_template", "get_book_post_type_template" ) ;

Yeah only the page templates are recognized & not the archive,single etc. templates. Your single file has to remain in the root folder.