From a9dab28f63f1299fad0d612765798dd38832abe0 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Mon, 4 Jan 2016 17:16:27 +0000 Subject: [PATCH] Template: Always display the site title on the front page. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- wp-includes/general-template.php | 16 ++++++---------- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 5b9049b9fd..151daf860c 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -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' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 5099a1a8b1..85772dbb1c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.