3

(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

6

Use:

$tax = $wp_query->get_queried_object();
printf( __( 'Posts classified under: %s', 'textdomain' ), '<span>' . $tax->name . '</span>' );
1
  • 2
    Beat me to it. :) I can only add that WP 3.1 will have this simplified with new single_term_title() function.
    – Rarst
    Oct 9, 2010 at 20:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.