Displaying the Name of the Queried Taxonomy Term on a Term Archive Page?

(Moderator’s note: post was originally entitled “Taxonomy.php title”)

How can I display the “Posts classified under:” title for the taxonomy.php page? For example, this code is used in tag.php:

printf( __( 'Tag Archives: %s', 'twentyten' ), 
   '<span>' . single_tag_title( '', false ) . '</span>' );

1 Answer
1

Use:

$tax = $wp_query->get_queried_object();
printf( __( 'Posts classified under: %s', 'textdomain' ), '<span>' . $tax->name . '</span>' );

Leave a Comment