X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/699231ae09f7057a4d0000cdf32e50a3df6a04ca..58f607a1de715c9bca69340a4d6fb9e1b9c2bed2:/wp-content/themes/twentyten/functions.php?ds=sidebyside diff --git a/wp-content/themes/twentyten/functions.php b/wp-content/themes/twentyten/functions.php index 3a61e9d8..d7a127a2 100644 --- a/wp-content/themes/twentyten/functions.php +++ b/wp-content/themes/twentyten/functions.php @@ -203,64 +203,6 @@ function twentyten_admin_header_style() { } endif; -/** - * Makes some changes to the tag, by filtering the output of wp_title(). - * - * If we have a site description and we're viewing the home page or a blog posts - * page (when using a static front page), then we will add the site description. - * - * If we're viewing a search result, then we're going to recreate the title entirely. - * We're going to add page numbers to all titles as well, to the middle of a search - * result title and the end of all other titles. - * - * The site title also gets added to all titles. - * - * @since Twenty Ten 1.0 - * - * @param string $title Title generated by wp_title() - * @param string $separator The separator passed to wp_title(). Twenty Ten uses a - * vertical bar, "|", as a separator in header.php. - * @return string The new title, ready for the <title> tag. - */ -function twentyten_filter_wp_title( $title, $separator ) { - // Don't affect wp_title() calls in feeds. - if ( is_feed() ) - return $title; - - // The $paged global variable contains the page number of a listing of posts. - // The $page global variable contains the page number of a single post that is paged. - // We'll display whichever one applies, if we're not looking at the first page. - global $paged, $page; - - if ( is_search() ) { - // If we're a search, let's start over: - $title = sprintf( __( 'Search results for %s', 'twentyten' ), '"' . get_search_query() . '"' ); - // Add a page number if we're on page 2 or more: - if ( $paged >= 2 ) - $title .= " $separator " . sprintf( __( 'Page %s', 'twentyten' ), $paged ); - // Add the site name to the end: - $title .= " $separator " . get_bloginfo( 'name', 'display' ); - // We're done. Let's send the new title back to wp_title(): - return $title; - } - - // Otherwise, let's start by adding the site name to the end: - $title .= get_bloginfo( 'name', 'display' ); - - // If we have a site description and we're on the home/front page, add the description: - $site_description = get_bloginfo( 'description', 'display' ); - if ( $site_description && ( is_home() || is_front_page() ) ) - $title .= " $separator " . $site_description; - - // Add a page number if necessary: - if ( $paged >= 2 || $page >= 2 ) - $title .= " $separator " . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ); - - // Return the new title to wp_title(): - return $title; -} -add_filter( 'wp_title', 'twentyten_filter_wp_title', 10, 2 ); - /** * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. *