滤器template_include
:
add_filter( \'template_include\', \'prefix_translate_template\' );
function prefix_translate_template( $template )
{
if ( \'category-\' . __( \'news\', \'your_textdomain\' ) . \'.php\' === $template )
return \'category-news.php\';
return $template;
}
但我认为在这种情况下,基于slug的模板不是一个好主意。