Different Templates For Different Categories
-
I have applied the above code to my site. But I am getting errors. I am pretty sure I got the code right. But I think the problem is due to permalinks. Anyone got any ideas?
I want to have a separate look for diferent categories on my site. I tried to implement this with the following code, but I am getting errors. Does anyone have any ideas how I can set different category templates successfully?<?php
$post = $wp_query->post;
if ( in_category(’13’) ) {
include(TEMPLATEPATH . ‘/single-computing.php’);
elseif ( in_category(‘4’) ) {
include(TEMPLATEPATH . ‘/single-film.php’);
} else {
include(TEMPLATEPATH . ‘/single-default.php’);
}
?>Example – https://www.alan-kay.com/category/computingClick on any post in this section and errors apppear.
The theme I am using is a rather hacked K2 Beta One 118 from Binary Bonsai.
- The topic ‘Different Templates For Different Categories’ is closed to new replies.