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
edit: I have several CPT single pages named single-{CPT-slug}.php
. Is it possible this is affecting things?