Custom template for specific posts
-
Hello,
I’m using this code in single.php so so i can have custom templates under each category:
<?php
$post = $wp_query->post;
if ( in_category(‘3’) ) {
include(TEMPLATEPATH . ‘/single3.php’);
} elseif ( in_category(‘227’) ) {
include(TEMPLATEPATH . ‘/single227.php’);
} else {
include(TEMPLATEPATH . ‘/single1.php’);
}
?>Now, i would like that all the posts wich have the word “green” in their post title under a specific category ( category 227 ) have single227green.php as custom template.
I think i should use the strpos php code but i don’t know how to.
Thanks for your help
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom template for specific posts’ is closed to new replies.