From 0a16bda6e3e8d60b41a94592e50b148a87d8bc67 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 4 May 2014 13:16:30 +0000 Subject: [PATCH] Prevent 'Page %s' from being added to page title on 404 error pages in bundled themes. props psoluch, rob1n. fixes #16468. git-svn-id: https://develop.svn.wordpress.org/trunk@28250 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-content/themes/twentyeleven/header.php | 2 +- src/wp-content/themes/twentyfourteen/functions.php | 2 +- src/wp-content/themes/twentyten/header.php | 2 +- src/wp-content/themes/twentythirteen/functions.php | 2 +- src/wp-content/themes/twentytwelve/functions.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-content/themes/twentyeleven/header.php b/src/wp-content/themes/twentyeleven/header.php index a39c75b118..09e0d9e3b8 100644 --- a/src/wp-content/themes/twentyeleven/header.php +++ b/src/wp-content/themes/twentyeleven/header.php @@ -39,7 +39,7 @@ echo " | $site_description"; // Add a page number if necessary: - if ( $paged >= 2 || $page >= 2 ) + if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) ); ?> diff --git a/src/wp-content/themes/twentyfourteen/functions.php b/src/wp-content/themes/twentyfourteen/functions.php index d78b44b262..68c2526d59 100644 --- a/src/wp-content/themes/twentyfourteen/functions.php +++ b/src/wp-content/themes/twentyfourteen/functions.php @@ -484,7 +484,7 @@ function twentyfourteen_wp_title( $title, $sep ) { } // Add a page number if necessary. - if ( $paged >= 2 || $page >= 2 ) { + if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { $title = "$title $sep " . sprintf( __( 'Page %s', 'twentyfourteen' ), max( $paged, $page ) ); } diff --git a/src/wp-content/themes/twentyten/header.php b/src/wp-content/themes/twentyten/header.php index 9f8aacc1ac..494b866191 100644 --- a/src/wp-content/themes/twentyten/header.php +++ b/src/wp-content/themes/twentyten/header.php @@ -29,7 +29,7 @@ echo " | $site_description"; // Add a page number if necessary: - if ( $paged >= 2 || $page >= 2 ) + if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ); ?> diff --git a/src/wp-content/themes/twentythirteen/functions.php b/src/wp-content/themes/twentythirteen/functions.php index 2cfd20fe4b..08f765270f 100644 --- a/src/wp-content/themes/twentythirteen/functions.php +++ b/src/wp-content/themes/twentythirteen/functions.php @@ -214,7 +214,7 @@ function twentythirteen_wp_title( $title, $sep ) { $title = "$title $sep $site_description"; // Add a page number if necessary. - if ( $paged >= 2 || $page >= 2 ) + if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) $title = "$title $sep " . sprintf( __( 'Page %s', 'twentythirteen' ), max( $paged, $page ) ); return $title; diff --git a/src/wp-content/themes/twentytwelve/functions.php b/src/wp-content/themes/twentytwelve/functions.php index c4055ba058..772ce087f1 100644 --- a/src/wp-content/themes/twentytwelve/functions.php +++ b/src/wp-content/themes/twentytwelve/functions.php @@ -209,7 +209,7 @@ function twentytwelve_wp_title( $title, $sep ) { $title = "$title $sep $site_description"; // Add a page number if necessary. - if ( $paged >= 2 || $page >= 2 ) + if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) $title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) ); return $title;