Displaying custom post type listing
Instead of using the ‘single_template’ filter use the more generic ‘template_include’ filter for both archive annd single post view: add_filter(‘template_include’, ‘my_custom_templates’); function my_custom_templates( $template ) { if ( is_single() && ( ‘book_reviews’ == get_post_type() ) ) { if ( ! locate_template(‘single-book_reviews.php’, false) ) $template = plugin_dir_path( __FILE__ ) . ‘/single-book_reviews.php’; } elseif( is_post_type_archive(‘book_reviews’) ) { … Read more