We have been working on the Leisure Holdings websites. All the sites are developed with WordPress. Here is a quick script to add to your functions.php so each category can have its own post template (single.php).


If the category number is 13 then the file name will be single-13.php

function get_category_post_template($single_template) {
global $post;

$categories = get_the_category($post->ID) ;

foreach ( $categories as $cat) {
if (file_exists( dirname( __FILE__ ) . "/single-{$cat->cat_ID}.php" ) )
$single_template = dirname( __FILE__ ) . "/single-{$cat->cat_ID}.php" ;
return $single_template;

add_filter( "single_template", "get_category_post_template" ) ;

Very simple