diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 763f414a6..b5f87ed84 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -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 "; diff --git a/wp-includes/query.php b/wp-includes/query.php index c8a93dbb3..8fb273101 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1610,8 +1610,9 @@ class WP_Query { $tax = $this->get('taxonomy'); $slug = $this->get('term'); $term = &get_terms($tax, array('slug'=>$slug)); - if ( is_wp_error($term) ) + if ( is_wp_error($term) || empty($term) ) return $term; + $term = $term[0]; $this->queried_object = $term; $this->queried_object_id = $term->term_id; } else if ($this->is_posts_page) {