Changeset 23718 for trunk/wp-content/themes/twentyeleven/functions.php
- Timestamp:
- 03/15/2013 06:15:58 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyeleven/functions.php
r23474 r23718 615 615 add_filter( 'body_class', 'twentyeleven_body_classes' ); 616 616 617 /** 618 * Creates a nicely formatted and more specific title element text 619 * for output in head of document, based on current view. 620 * 621 * @since Twenty Eleven 1.6 622 * 623 * @param string $title Default title text for current view. 624 * @param string $sep Optional separator. 625 * @return string Filtered title. 626 */ 627 function twentyeleven_wp_title( $title, $sep ) { 628 global $paged, $page; 629 630 if ( is_feed() ) 631 return $title; 632 633 // Add the site name. 634 $title .= get_bloginfo( 'name' ); 635 636 // Add the site description for the home/front page. 637 $site_description = get_bloginfo( 'description', 'display' ); 638 if ( $site_description && ( is_home() || is_front_page() ) ) 639 $title = "$title $sep $site_description"; 640 641 // Add a page number if necessary. 642 if ( $paged >= 2 || $page >= 2 ) 643 $title = "$title $sep " . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) ); 644 645 return $title; 646 } 647 add_filter( 'wp_title', 'twentyeleven_wp_title', 10, 2 );
Note: See TracChangeset
for help on using the changeset viewer.