From 2c97f4640baf02d4f77058d58285d1c881439944 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 4 May 2014 13:17:28 +0000 Subject: [PATCH] Prevent 'Page %s' from being added to page title on 404 error pages in bundled themes. props psoluch, rob1n. fixes #16468. Built from https://develop.svn.wordpress.org/trunk@28250 git-svn-id: http://core.svn.wordpress.org/trunk@28078 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyeleven/header.php | 2 +- wp-content/themes/twentyfourteen/functions.php | 2 +- wp-content/themes/twentyten/header.php | 2 +- wp-content/themes/twentythirteen/functions.php | 2 +- wp-content/themes/twentytwelve/functions.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-content/themes/twentyeleven/header.php b/wp-content/themes/twentyeleven/header.php index a39c75b118..09e0d9e3b8 100644 --- a/wp-content/themes/twentyeleven/header.php +++ b/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/wp-content/themes/twentyfourteen/functions.php b/wp-content/themes/twentyfourteen/functions.php index d78b44b262..68c2526d59 100644 --- a/wp-content/themes/twentyfourteen/functions.php +++ b/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/wp-content/themes/twentyten/header.php b/wp-content/themes/twentyten/header.php index 9f8aacc1ac..494b866191 100644 --- a/wp-content/themes/twentyten/header.php +++ b/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/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index 2cfd20fe4b..08f765270f 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/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/wp-content/themes/twentytwelve/functions.php b/wp-content/themes/twentytwelve/functions.php index c4055ba058..772ce087f1 100644 --- a/wp-content/themes/twentytwelve/functions.php +++ b/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;