WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/10/2010 06:26:53 PM (10 years ago)
Author:
nacin
Message:

Use wp_title() proper in Twenty Ten, and move the janky stuff to a filter. see #13751.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyten/header.php

    r15082 r15195  
    1212<html <?php language_attributes(); ?>>
    1313<head>
    14     <meta charset="<?php bloginfo( 'charset' ); ?>" />
    15     <title>
    16     <?php // Returns the title based on what is being viewed
    17         if ( is_single() ) { // single posts
    18             single_post_title(); echo ' | '; bloginfo( 'name' );
    19         // The home page or, if using a static front page, the blog posts page.
    20         } elseif ( is_home() || is_front_page() ) {
    21             bloginfo( 'name' );
    22             if( get_bloginfo( 'description' ) )
    23                 echo ' | ' ; bloginfo( 'description' );
    24             twentyten_the_page_number();
    25         } elseif ( is_page() ) { // WordPress Pages
    26             single_post_title( '' ); echo ' | '; bloginfo( 'name' );
    27         } elseif ( is_search() ) { // Search results
    28             printf( __( 'Search results for %s', 'twentyten' ), '"'.get_search_query().'"' ); twentyten_the_page_number(); echo ' | '; bloginfo( 'name' );
    29         } elseif ( is_404() ) {  // 404 (Not Found)
    30             _e( 'Not Found', 'twentyten' ); echo ' | '; bloginfo( 'name' );
    31         } else { // Otherwise:
    32             wp_title( '' ); echo ' | '; bloginfo( 'name' ); twentyten_the_page_number();
    33         }
    34     ?>
    35     </title>
    36     <link rel="profile" href="http://gmpg.org/xfn/11" />
    37     <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    38     <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
     14<meta charset="<?php bloginfo( 'charset' ); ?>" />
     15<title><?php
     16    /*
     17     * Print the <title> tag based on what is being viewed.
     18     * We filter the output of wp_title() a bit -- see
     19     * twentyten_filter_wp_title() in functions.php.
     20     */
     21    wp_title( '|', true, 'right' );
     22
     23    ?></title>
     24<link rel="profile" href="http://gmpg.org/xfn/11" />
     25<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
     26<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    3927<?php
    4028    /* We add some JavaScript to pages with the comment form
     
    4937     * as styles, scripts, and meta tags.
    5038     */
    51 
    5239    wp_head();
    5340?>
Note: See TracChangeset for help on using the changeset viewer.