(Moderator\'s note: 这篇文章最初的标题是“Taxonomy.php title”)
如何显示分类在以下标题下的帖子:taxonomy.php
页例如,此代码用于tag.php
:
printf( __( \'Tag Archives: %s\', \'twentyten\' ),
\'<span>\' . single_tag_title( \'\', false ) . \'</span>\' );
最合适的回答,由SO网友:sorich87 整理而成
Use:
$tax = $wp_query->get_queried_object();
printf( __( \'Posts classified under: %s\', \'textdomain\' ), \'<span>\' . $tax->name . \'</span>\' );