Is it possible to modify this plugin so that sub-sub-categories can inherit the template? I tried this modification but it didn’t seem to work:
function szub_cat_template_inherit() {
if(is_category()) {
global $wp_query;
$category = $wp_query->get_queried_object();
if( $category->category_parent && $category->category_parent->category_parent )
$template = TEMPLATEPATH . '/category-' . $category->category_parent->category_parent . '.php';
elseif( $category->category_parent && file_exists(TEMPLATEPATH . '/category-' . $category->category_parent . '.php') )
$template = TEMPLATEPATH . '/category-' . $category->category_parent . '.php';
elseif( file_exists(TEMPLATEPATH . "/category-" . get_query_var('cat') . '.php') )
$template = TEMPLATEPATH . "/category-" . get_query_var('cat') . '.php';
elseif( file_exists(TEMPLATEPATH . "/category.php") )
$template = TEMPLATEPATH . "/category.php";
return $template;
}
}