Twenty Ten and Twenty Eleven: revert r23720 and r23721 (closes #23772) and r23718 and r23719 (closes #23774).

Unfortunately, it's too late for these improvements in older themes since it's very likely they'll adversely affect child themes.

git-svn-id: https://develop.svn.wordpress.org/trunk@23778 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Lance Willett 2013-03-22 16:15:24 +00:00
parent 7a1610bf7c
commit 2376c91374
4 changed files with 56 additions and 108 deletions

View File

@ -326,27 +326,6 @@ function twentyeleven_admin_header_image() { ?>
<?php }
endif; // twentyeleven_admin_header_image
/**
* Enqueue scripts and styles.
*
* Hooked on priority 0 to make sure they are enqueued prior to dependent
* scripts/styles. This is only necessary because they were previously enqueued
* prior to wp_head() running, and we want to provide maximum
* backwards compatibility.
*
* @since Twenty Eleven 1.6
*/
function twentyeleven_scripts() {
wp_enqueue_style( 'twentyeleven', get_stylesheet_uri() );
/* We add some JavaScript to pages with the comment form
* to support sites with threaded comments (when in use).
*/
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'twentyeleven_scripts', 0 );
/**
* Sets the post excerpt length to 40 words.
*
@ -634,35 +613,3 @@ function twentyeleven_body_classes( $classes ) {
return $classes;
}
add_filter( 'body_class', 'twentyeleven_body_classes' );
/**
* Creates a nicely formatted and more specific title element text
* for output in head of document, based on current view.
*
* @since Twenty Eleven 1.6
*
* @param string $title Default title text for current view.
* @param string $sep Optional separator.
* @return string Filtered title.
*/
function twentyeleven_wp_title( $title, $sep ) {
global $paged, $page;
if ( is_feed() )
return $title;
// Add the site name.
$title .= get_bloginfo( 'name' );
// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title = "$title $sep $site_description";
// Add a page number if necessary.
if ( $paged >= 2 || $page >= 2 )
$title = "$title $sep " . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'twentyeleven_wp_title', 10, 2 );

View File

@ -24,13 +24,40 @@
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<title><?php
/*
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );
?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php
/* We add some JavaScript to pages with the comment form
* to support sites with threaded comments (when in use).
*/
if ( is_singular() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
/* Always have wp_head() just before the closing </head>
* tag of your theme, or you will break many plugins, which
* generally use this hook to add elements to <head> such

View File

@ -215,27 +215,6 @@ function twentyten_admin_header_style() {
}
endif;
/**
* Enqueue scripts and styles.
*
* Hooked on priority 0 to make sure they are enqueued prior to dependent
* scripts/styles. This is only necessary because they were previously enqueued
* prior to wp_head() running, and we want to provide maximum
* backwards compatibility.
*
* @since Twenty Ten 1.6
*/
function twentyten_scripts() {
wp_enqueue_style( 'twentyten', get_stylesheet_uri() );
/* We add some JavaScript to pages with the comment form
* to support sites with threaded comments (when in use).
*/
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'twentyten_scripts', 0 );
/**
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
*
@ -535,35 +514,3 @@ function twentyten_posted_in() {
);
}
endif;
/**
* Creates a nicely formatted and more specific title element text
* for output in head of document, based on current view.
*
* @since Twenty Ten 1.6
*
* @param string $title Default title text for current view.
* @param string $sep Optional separator.
* @return string Filtered title.
*/
function twentyten_wp_title( $title, $sep ) {
global $paged, $page;
if ( is_feed() )
return $title;
// Add the site name.
$title .= get_bloginfo( 'name' );
// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title = "$title $sep $site_description";
// Add a page number if necessary.
if ( $paged >= 2 || $page >= 2 )
$title = "$title $sep " . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'twentyten_wp_title', 10, 2 );

View File

@ -12,10 +12,37 @@
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<title><?php
/*
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
/* We add some JavaScript to pages with the comment form
* to support sites with threaded comments (when in use).
*/
if ( is_singular() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
/* Always have wp_head() just before the closing </head>
* tag of your theme, or you will break many plugins, which
* generally use this hook to add elements to <head> such