Dynamic WordPress Themes
Word press themes can be load dynamically depending upon the category ID. Suppose you have 3 category in your site and U would like to load different layout for the different category then it’s possiblein WordPress; Here U have to declare you PHP Code as follow:

<?php
if (is_category(7)) {
// looking for category 7 posts
include(TEMPLATEPATH . ‘/single7.php’);
} else {
// put this on every other category post
include(TEMPLATEPATH . ‘/index.php’);
}
?>
OR U can write in another method too
<?php

$post = $wp_query->post;
if ( in_category(‘7’) ) {
include(TEMPLATEPATH . ‘/category7.php’);
} else {
include(TEMPLATEPATH . ‘/index.php’);
}
?>

Advertisements