DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Different Single Templates

10.11.2008
| 1612 views |
  • submit to reddit
        // description of your code here

<?php
$post = $wp_query->post;
if ( in_category('5') ) {
include(TEMPLATEPATH . '/single5.php'); } 
elseif ( in_category('3') ) {
include(TEMPLATEPATH . '/single3.php'); } 
elseif ( in_category('4') ) {
include(TEMPLATEPATH . '/single4.php'); } 
else {
include(TEMPLATEPATH . '/single-default.php');
}
?>