Changeset 23719
- Timestamp:
- 03/15/2013 06:16:47 PM (13 years ago)
- Location:
- trunk/wp-content/themes/twentyten
- Files:
-
- 2 edited
-
functions.php (modified) (1 diff)
-
header.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyten/functions.php
r23477 r23719 515 515 } 516 516 endif; 517 518 /** 519 * Creates a nicely formatted and more specific title element text 520 * for output in head of document, based on current view. 521 * 522 * @since Twenty Ten 1.6 523 * 524 * @param string $title Default title text for current view. 525 * @param string $sep Optional separator. 526 * @return string Filtered title. 527 */ 528 function twentyten_wp_title( $title, $sep ) { 529 global $paged, $page; 530 531 if ( is_feed() ) 532 return $title; 533 534 // Add the site name. 535 $title .= get_bloginfo( 'name' ); 536 537 // Add the site description for the home/front page. 538 $site_description = get_bloginfo( 'description', 'display' ); 539 if ( $site_description && ( is_home() || is_front_page() ) ) 540 $title = "$title $sep $site_description"; 541 542 // Add a page number if necessary. 543 if ( $paged >= 2 || $page >= 2 ) 544 $title = "$title $sep " . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ); 545 546 return $title; 547 } 548 add_filter( 'wp_title', 'twentyten_wp_title', 10, 2 ); -
trunk/wp-content/themes/twentyten/header.php
r20983 r23719 13 13 <head> 14 14 <meta charset="<?php bloginfo( 'charset' ); ?>" /> 15 <title><?php 16 /* 17 * Print the <title> tag based on what is being viewed. 18 */ 19 global $page, $paged; 20 21 wp_title( '|', true, 'right' ); 22 23 // Add the blog name. 24 bloginfo( 'name' ); 25 26 // Add the blog description for the home/front page. 27 $site_description = get_bloginfo( 'description', 'display' ); 28 if ( $site_description && ( is_home() || is_front_page() ) ) 29 echo " | $site_description"; 30 31 // Add a page number if necessary: 32 if ( $paged >= 2 || $page >= 2 ) 33 echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ); 34 35 ?></title> 15 <title><?php wp_title( '|', true, 'right' ); ?></title> 36 16 <link rel="profile" href="http://gmpg.org/xfn/11" /> 37 17 <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
Note: See TracChangeset
for help on using the changeset viewer.