Custom template for sub-sub-categories

I’m trying to add a custom template for all posts in a sub-sub-category. I mean like

Category –> SubCategory Level 1 –> Subcategory Level 2 –> post

I’m using the following code:

<?php
$post = $wp_query->post;

if (cat_is_ancestor_of( 42, $cat ) ) {
include(TEMPLATEPATH.’/services_template.php’);
} else {
include(TEMPLATEPATH.’/single-default.php’);
}
?>

However, it only shows a blank page, both in the sub-sub-cat post as well as all teh other posts. I double checked and the templates are there, so I guess there’s something wrong with my code, but can’t figure what

Read more here:: Custom template for sub-sub-categories

Leave a Reply

Your email address will not be published. Required fields are marked *