Changeset 30097
- Timestamp:
- 10/29/2014 09:55:24 PM (10 years ago)
- Location:
- trunk/src/wp-content/themes/twentyfifteen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfifteen/functions.php
r30072 r30097 57 57 // Add default posts and comments RSS feed links to head. 58 58 add_theme_support( 'automatic-feed-links' ); 59 60 61 62 63 64 65 66 59 67 60 68 /* … … 227 235 228 236 /** 229 * Filters wp_title to print a neat <title> tag based on what is being viewed.230 *231 * @param string $title Default title text for current view.232 * @param string $sep Optional separator.233 * @return string The filtered title.234 */235 function twentyfifteen_wp_title( $title, $sep ) {236 if ( is_feed() ) {237 return $title;238 }239 240 global $page, $paged;241 242 // Add the blog name243 $title .= get_bloginfo( 'name', 'display' );244 245 // Add the blog description for the home/front page.246 $site_description = get_bloginfo( 'description', 'display' );247 if ( $site_description && ( is_home() || is_front_page() ) ) {248 $title .= " $sep $site_description";249 }250 251 // Add a page number if necessary:252 if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {253 $title .= " $sep " . sprintf( __( 'Page %s', 'twentyfifteen' ), max( $paged, $page ) );254 }255 256 return $title;257 }258 add_filter( 'wp_title', 'twentyfifteen_wp_title', 10, 2 );259 260 /**261 237 * Add featured image as background image to post navs. 262 238 * -
trunk/src/wp-content/themes/twentyfifteen/header.php
r30072 r30097 14 14 <meta charset="<?php bloginfo( 'charset' ); ?>"> 15 15 <meta name="viewport" content="width=device-width, initial-scale=1"> 16 <title><?php wp_title( '|', true, 'right' ); ?></title>17 16 <link rel="profile" href="http://gmpg.org/xfn/11"> 18 17 <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
Note: See TracChangeset
for help on using the changeset viewer.