如果您可以使用template_redirect
钩子和一个简单的函数来设置要使用的模板
add_action( \'template_redirect\', \'category_set_redirect\' );
function category_set_redirect(){
//create the sets of categories
$first_set= array("1","2","3","4","5","6");
$second_set= array("7","8","9","10","11","12");
if (is_category()){
if (in_array(get_query_var(\'cat\'),$first_set)){
include(TEMPLATEPATH . "/first_category.php"); // include the corresponding template
die();
}
if (in_array(get_query_var(\'cat\'),$second_set)){
include(TEMPLATEPATH . "/second_category.php"); // include the corresponding template
die();
}
}
}