same post different templates based on category
-
Hi
I have couple of posts related to multiple categories each.
I would like to have a different template for each post based on the category the viewer is currently in
currently I changed my single.php to –
<?php
$post = $wp_query->post;if (in_category(‘3,4’)) {
include(TEMPLATEPATH.’/single-a.php’);
} else {
include(TEMPLATEPATH.’/single-b.php’);
}
?>but I still get it wrong same template no matter what category Im currently viewing
any idea
thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘same post different templates based on category’ is closed to new replies.