diff --git a/wp-content/themes/twentyten/functions.php b/wp-content/themes/twentyten/functions.php index ea5f8c5244..3e8fd3bd26 100644 --- a/wp-content/themes/twentyten/functions.php +++ b/wp-content/themes/twentyten/functions.php @@ -514,3 +514,35 @@ function twentyten_posted_in() { ); } endif; + +/** + * Creates a nicely formatted and more specific title element text + * for output in head of document, based on current view. + * + * @since Twenty Ten 1.6 + * + * @param string $title Default title text for current view. + * @param string $sep Optional separator. + * @return string Filtered title. + */ +function twentyten_wp_title( $title, $sep ) { + global $paged, $page; + + if ( is_feed() ) + return $title; + + // Add the site name. + $title .= get_bloginfo( 'name' ); + + // Add the site description for the home/front page. + $site_description = get_bloginfo( 'description', 'display' ); + if ( $site_description && ( is_home() || is_front_page() ) ) + $title = "$title $sep $site_description"; + + // Add a page number if necessary. + if ( $paged >= 2 || $page >= 2 ) + $title = "$title $sep " . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ); + + return $title; +} +add_filter( 'wp_title', 'twentyten_wp_title', 10, 2 ); diff --git a/wp-content/themes/twentyten/header.php b/wp-content/themes/twentyten/header.php index 50cb37589d..41eaea52f1 100644 --- a/wp-content/themes/twentyten/header.php +++ b/wp-content/themes/twentyten/header.php @@ -12,27 +12,7 @@ >
-