get_queried_object should not return an array of terms, and wp_title should check is_tax. Hat tip: andy

git-svn-id: https://develop.svn.wordpress.org/trunk@7941 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg
2008-05-16 03:57:09 +00:00
parent fc437f1276
commit ea8035697d
2 changed files with 15 additions and 1 deletions
+13
View File
@@ -233,6 +233,19 @@ function wp_title($sep = '»', $display = true, $seplocation = '') {
$title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );
}
// If there's a taxonomy
if ( is_tax() ) {
$taxonomy = get_query_var( 'taxonomy' );
$tax = get_taxonomy( $taxonomy );
$tax = $tax->label;
$term = $wp_query->get_queried_object();
$term = $term->name;
if ( 'right' == $seplocation )
$title = "$term $sep $tax";
else
$title = "$tax $sep $term";
}
$prefix = '';
if ( !empty($title) )
$prefix = " $sep ";