Template: Always display the site title on the front page.

Limits using the page title to the blog page when the site has a static front page,
bringing it N’Sync with `wp_title()`.

Props peterwilsoncc.
Fixes #34962.


Built from https://develop.svn.wordpress.org/trunk@36168


git-svn-id: http://core.svn.wordpress.org/trunk@36134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Konstantin Obenland 2016-01-04 17:16:27 +00:00
parent 6abb7e6284
commit a9dab28f63
2 changed files with 7 additions and 11 deletions

View File

@ -856,8 +856,8 @@ function wp_get_document_title() {
/* translators: %s: search phrase */
$title['title'] = sprintf( __( 'Search Results for “%s”' ), get_search_query() );
// If on the home or front page, use the site title.
} elseif ( is_home() && is_front_page() ) {
// If on the front page, use the site title.
} elseif ( is_front_page() ) {
$title['title'] = get_bloginfo( 'name', 'display' );
// If on a post type archive, use the post type archive title.
@ -869,14 +869,10 @@ function wp_get_document_title() {
$title['title'] = single_term_title( '', false );
/*
* If we're on the blog page and that page is not the homepage or a single
* page that is designated as the homepage, use the container page's title.
* If we're on the blog page that is not the homepage or
* a single post of any post type, use the post title.
*/
} elseif ( ( is_home() && ! is_front_page() ) || ( ! is_home() && is_front_page() ) ) {
$title['title'] = single_post_title( '', false );
// If on a single post of any post type, use the post title.
} elseif ( is_singular() ) {
} elseif ( is_home() || is_singular() ) {
$title['title'] = single_post_title( '', false );
// If on a category or tag archive, use the term title.
@ -904,7 +900,7 @@ function wp_get_document_title() {
}
// Append the description or site title to give context.
if ( is_home() && is_front_page() ) {
if ( is_front_page() ) {
$title['tagline'] = get_bloginfo( 'description', 'display' );
} else {
$title['site'] = get_bloginfo( 'name', 'display' );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-36166';
$wp_version = '4.5-alpha-36168';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.