Make WordPress Core

Ticket #30146: 30146.diff

File 30146.diff, 2.4 KB (added by obenland, 10 years ago)
  • src/wp-content/themes/twentyfifteen/functions.php

     
    5858        add_theme_support( 'automatic-feed-links' );
    5959
    6060        /*
     61         * Let WordPress manage the document title.
     62         * By adding theme support, we declare that this theme does not use a
     63         * hard-coded <title> tag in the document head, and expect WordPress to
     64         * provide it for us.
     65         */
     66        add_theme_support( 'title-tag' );
     67
     68        /*
    6169         * Enable support for Post Thumbnails on posts and pages.
    6270         *
    6371         * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
     
    226234add_action( 'wp_enqueue_scripts', 'twentyfifteen_scripts' );
    227235
    228236/**
    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 name
    243         $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 /**
    261237 * Add featured image as background image to post navs.
    262238 *
    263239 * @since Twenty Fifteen 1.0
  • src/wp-content/themes/twentyfifteen/header.php

     
    1313<head>
    1414        <meta charset="<?php bloginfo( 'charset' ); ?>">
    1515        <meta name="viewport" content="width=device-width, initial-scale=1">
    16         <title><?php wp_title( '|', true, 'right' ); ?></title>
    1716        <link rel="profile" href="http://gmpg.org/xfn/11">
    1817        <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    1918        <!--[if lt IE 9]>