Changeset 23778
- Timestamp:
- 03/22/2013 04:15:24 PM (13 years ago)
- Location:
- trunk/wp-content/themes
- Files:
-
- 4 edited
-
twentyeleven/functions.php (modified) (2 diffs)
-
twentyeleven/header.php (modified) (2 diffs)
-
twentyten/functions.php (modified) (2 diffs)
-
twentyten/header.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyeleven/functions.php
r23720 r23778 328 328 329 329 /** 330 * Enqueue scripts and styles.331 *332 * Hooked on priority 0 to make sure they are enqueued prior to dependent333 * scripts/styles. This is only necessary because they were previously enqueued334 * prior to wp_head() running, and we want to provide maximum335 * backwards compatibility.336 *337 * @since Twenty Eleven 1.6338 */339 function twentyeleven_scripts() {340 wp_enqueue_style( 'twentyeleven', get_stylesheet_uri() );341 342 /* We add some JavaScript to pages with the comment form343 * to support sites with threaded comments (when in use).344 */345 if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )346 wp_enqueue_script( 'comment-reply' );347 }348 add_action( 'wp_enqueue_scripts', 'twentyeleven_scripts', 0 );349 350 /**351 330 * Sets the post excerpt length to 40 words. 352 331 * … … 635 614 } 636 615 add_filter( 'body_class', 'twentyeleven_body_classes' ); 637 638 /**639 * Creates a nicely formatted and more specific title element text640 * for output in head of document, based on current view.641 *642 * @since Twenty Eleven 1.6643 *644 * @param string $title Default title text for current view.645 * @param string $sep Optional separator.646 * @return string Filtered title.647 */648 function twentyeleven_wp_title( $title, $sep ) {649 global $paged, $page;650 651 if ( is_feed() )652 return $title;653 654 // Add the site name.655 $title .= get_bloginfo( 'name' );656 657 // Add the site description for the home/front page.658 $site_description = get_bloginfo( 'description', 'display' );659 if ( $site_description && ( is_home() || is_front_page() ) )660 $title = "$title $sep $site_description";661 662 // Add a page number if necessary.663 if ( $paged >= 2 || $page >= 2 )664 $title = "$title $sep " . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );665 666 return $title;667 }668 add_filter( 'wp_title', 'twentyeleven_wp_title', 10, 2 ); -
trunk/wp-content/themes/twentyeleven/header.php
r23720 r23778 25 25 <meta charset="<?php bloginfo( 'charset' ); ?>" /> 26 26 <meta name="viewport" content="width=device-width" /> 27 <title><?php wp_title( '|', true, 'right' ); ?></title> 27 <title><?php 28 /* 29 * Print the <title> tag based on what is being viewed. 30 */ 31 global $page, $paged; 32 33 wp_title( '|', true, 'right' ); 34 35 // Add the blog name. 36 bloginfo( 'name' ); 37 38 // Add the blog description for the home/front page. 39 $site_description = get_bloginfo( 'description', 'display' ); 40 if ( $site_description && ( is_home() || is_front_page() ) ) 41 echo " | $site_description"; 42 43 // Add a page number if necessary: 44 if ( $paged >= 2 || $page >= 2 ) 45 echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) ); 46 47 ?></title> 28 48 <link rel="profile" href="http://gmpg.org/xfn/11" /> 49 <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> 29 50 <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> 30 51 <!--[if lt IE 9]> … … 32 53 <![endif]--> 33 54 <?php 55 /* We add some JavaScript to pages with the comment form 56 * to support sites with threaded comments (when in use). 57 */ 58 if ( is_singular() && get_option( 'thread_comments' ) ) 59 wp_enqueue_script( 'comment-reply' ); 60 34 61 /* Always have wp_head() just before the closing </head> 35 62 * tag of your theme, or you will break many plugins, which -
trunk/wp-content/themes/twentyten/functions.php
r23721 r23778 215 215 } 216 216 endif; 217 218 /**219 * Enqueue scripts and styles.220 *221 * Hooked on priority 0 to make sure they are enqueued prior to dependent222 * scripts/styles. This is only necessary because they were previously enqueued223 * prior to wp_head() running, and we want to provide maximum224 * backwards compatibility.225 *226 * @since Twenty Ten 1.6227 */228 function twentyten_scripts() {229 wp_enqueue_style( 'twentyten', get_stylesheet_uri() );230 231 /* We add some JavaScript to pages with the comment form232 * to support sites with threaded comments (when in use).233 */234 if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )235 wp_enqueue_script( 'comment-reply' );236 }237 add_action( 'wp_enqueue_scripts', 'twentyten_scripts', 0 );238 217 239 218 /** … … 536 515 } 537 516 endif; 538 539 /**540 * Creates a nicely formatted and more specific title element text541 * for output in head of document, based on current view.542 *543 * @since Twenty Ten 1.6544 *545 * @param string $title Default title text for current view.546 * @param string $sep Optional separator.547 * @return string Filtered title.548 */549 function twentyten_wp_title( $title, $sep ) {550 global $paged, $page;551 552 if ( is_feed() )553 return $title;554 555 // Add the site name.556 $title .= get_bloginfo( 'name' );557 558 // Add the site description for the home/front page.559 $site_description = get_bloginfo( 'description', 'display' );560 if ( $site_description && ( is_home() || is_front_page() ) )561 $title = "$title $sep $site_description";562 563 // Add a page number if necessary.564 if ( $paged >= 2 || $page >= 2 )565 $title = "$title $sep " . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );566 567 return $title;568 }569 add_filter( 'wp_title', 'twentyten_wp_title', 10, 2 ); -
trunk/wp-content/themes/twentyten/header.php
r23721 r23778 13 13 <head> 14 14 <meta charset="<?php bloginfo( 'charset' ); ?>" /> 15 <title><?php wp_title( '|', true, 'right' ); ?></title> 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> 16 36 <link rel="profile" href="http://gmpg.org/xfn/11" /> 37 <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> 17 38 <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> 18 39 <?php 40 /* We add some JavaScript to pages with the comment form 41 * to support sites with threaded comments (when in use). 42 */ 43 if ( is_singular() && get_option( 'thread_comments' ) ) 44 wp_enqueue_script( 'comment-reply' ); 45 19 46 /* Always have wp_head() just before the closing </head> 20 47 * tag of your theme, or you will break many plugins, which
Note: See TracChangeset
for help on using the changeset viewer.