function szub_cat_template_inherit() { if(is_category()) { global $wp_query; $category = $wp_query->get_queried_object(); if( $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; } } add_filter('category_template', 'szub_cat_template_inherit');