It sounds like you are talking about this page display template:
page-{slug}.php
– If the page slug isrecent-news
, WordPress will look
to usepage-recent-news.php
And you want single-{cpt-slug}-{slug}.php
.
If so, I believe you can approximate that page template handling with the following:
function cpt_slug_template_wpse_117630($template) {
global $post;
$templ = locate_template('single-'.$post->post_type.'-'.$post->post_name.'.php');
if (
'book' == $post->post_type
&& 'poem' == $post->post_name
&& !empty($templ)) {
$template = get_stylesheet_directory().'/single-'.$post->post_type.'-'.$post->post_name.'.php';
}
return $template;
}
add_filter('single_template','cpt_slug_template_wpse_117630');