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

Use:

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

Leave a Comment