You can add a check to see if the current page is the home page, and if so skip adding the page title. This would make the final code look like this:
<title><?php
global $page, $paged;
// Add the page title if not the front page
if ( is_front_page() ) {
wp_title( '|', true, 'right' );
}
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );
?></title>
However, the best thing to do would be to use this code in header.php
:
<title><?php wp_title( '|', true, 'right' ); ?></title>
And then filter the title using this code in functions.php
:
function wpse_132052_wp_title( $title, $sep ) {
global $paged, $page;
// Add the blog name
$title .= get_bloginfo( 'name' );
// Use the site name and description for the home/front page
if ( is_home() || is_front_page() ) {
$title = get_bloginfo( 'name' );
// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( ) ) {
$title = "$title $sep $site_description";
}
}
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 ) {
echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );
}
return $title;
}
add_filter( 'wp_title', 'wpse_132052_wp_title', 10, 2 );