Twenty Ten spacing and string cleanups. props zeo, markmcwilliams. see #13198. Add a twentyten_credits filter, props nathanrice, fixes #12804. Also clean up the generator/credits string.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-05-04 07:01:09 +00:00
parent 86c5154557
commit 3e035809a1
8 changed files with 41 additions and 44 deletions

View File

@ -96,7 +96,7 @@
<?php elseif ( ! comments_open() && ! pings_open() ) : // Comments and trackbacks closed ?>
<?php _e( 'Both comments and trackbacks are currently closed.', 'twentyten' ); ?>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
<?php edit_post_link( __( 'Edit', 'twentyten' ), ' <span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-utility -->
</div><!-- #post-<?php the_ID(); ?> -->

View File

@ -29,7 +29,7 @@
<?php if ( have_comments() ) : ?>
<h3 id="comments-title">
<?php
printf( _n('One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'twentyten'),
printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'twentyten' ),
number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' );
?>
</h3>

View File

@ -23,7 +23,8 @@
</div>
<div id="site-generator">
<?php printf( __( 'Proudly powered by <span id="generator-link">%s</span>.', 'twentyten' ), '<a href="http://wordpress.org/" title="' . esc_attr__( 'Semantic Personal Publishing Platform', 'twentyten' ) . '" rel="generator">' . __( 'WordPress', 'twentyten' ) . '</a>' ); ?>
<?php do_action('twentyten_credits' ); ?>
<a href="http://wordpress.org/" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyten' ); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s.', 'twentyten' ), 'WordPress' ); ?></a>
</div>
</div><!-- #colophon -->

View File

@ -104,8 +104,8 @@ function twentyten_setup() {
// The height and width of your custom header. You can hook into the theme's own filters to change these values.
// Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values.
define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) );
define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) );
define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) );
define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) );
// We'll be using post thumbnails for custom header images on posts and pages.
// We want them to be 940 pixels wide by 198 pixels tall (larger images will be auto-cropped to fit).
@ -227,7 +227,7 @@ add_filter( 'excerpt_length', 'twentyten_excerpt_length' );
* @return string A pretty 'Continue reading' link.
*/
function twentyten_excerpt_more( $more ) {
return '&nbsp;&hellip; <a href="'. get_permalink() . '">' . __('Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten') . '</a>';
return ' &hellip; <a href="'. get_permalink() . '">' . __('Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten') . '</a>';
}
add_filter( 'excerpt_more', 'twentyten_excerpt_more' );
@ -268,7 +268,7 @@ function twentyten_comment( $comment, $args, $depth ) {
<br />
<?php endif; ?>
<div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ),' ','' ); ?></div>
<div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></div>
<div class="comment-body"><?php comment_text(); ?></div>
@ -279,7 +279,7 @@ function twentyten_comment( $comment, $args, $depth ) {
<?php else : ?>
<li class="post pingback">
<p><?php _e( 'Pingback: ', 'twentyten' ); ?><?php comment_author_link(); ?><?php edit_comment_link ( __('edit', 'twentyten'), '&nbsp;&nbsp;', '' ); ?></p>
<p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link ( __('(Edit)', 'twentyten'), ' ' ); ?></p>
<?php endif;
}
endif;
@ -294,9 +294,9 @@ endif;
function twentyten_widgets_init() {
// Area 1
register_sidebar( array (
'name' => __( 'Primary Widget Area' , 'twentyten' ),
'name' => __( 'Primary Widget Area', 'twentyten' ),
'id' => 'primary-widget-area',
'description' => __( 'The primary widget area' , 'twentyten' ),
'description' => __( 'The primary widget area', 'twentyten' ),
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
'after_widget' => "</li>",
'before_title' => '<h3 class="widget-title">',
@ -305,9 +305,9 @@ function twentyten_widgets_init() {
// Area 2
register_sidebar( array (
'name' => __( 'Secondary Widget Area' , 'twentyten' ),
'name' => __( 'Secondary Widget Area', 'twentyten' ),
'id' => 'secondary-widget-area',
'description' => __( 'The secondary widget area' , 'twentyten' ),
'description' => __( 'The secondary widget area', 'twentyten' ),
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
'after_widget' => "</li>",
'before_title' => '<h3 class="widget-title">',
@ -316,9 +316,9 @@ function twentyten_widgets_init() {
// Area 3
register_sidebar( array (
'name' => __( 'First Footer Widget Area' , 'twentyten' ),
'name' => __( 'First Footer Widget Area', 'twentyten' ),
'id' => 'first-footer-widget-area',
'description' => __( 'The first footer widget area' , 'twentyten' ),
'description' => __( 'The first footer widget area', 'twentyten' ),
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
'after_widget' => "</li>",
'before_title' => '<h3 class="widget-title">',
@ -327,9 +327,9 @@ function twentyten_widgets_init() {
// Area 4
register_sidebar( array (
'name' => __( 'Second Footer Widget Area' , 'twentyten' ),
'name' => __( 'Second Footer Widget Area', 'twentyten' ),
'id' => 'second-footer-widget-area',
'description' => __( 'The second footer widget area' , 'twentyten' ),
'description' => __( 'The second footer widget area', 'twentyten' ),
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
'after_widget' => "</li>",
'before_title' => '<h3 class="widget-title">',
@ -338,9 +338,9 @@ function twentyten_widgets_init() {
// Area 5
register_sidebar( array (
'name' => __( 'Third Footer Widget Area' , 'twentyten' ),
'name' => __( 'Third Footer Widget Area', 'twentyten' ),
'id' => 'third-footer-widget-area',
'description' => __( 'The third footer widget area' , 'twentyten' ),
'description' => __( 'The third footer widget area', 'twentyten' ),
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
'after_widget' => "</li>",
'before_title' => '<h3 class="widget-title">',
@ -349,9 +349,9 @@ function twentyten_widgets_init() {
// Area 6
register_sidebar( array (
'name' => __( 'Fourth Footer Widget Area' , 'twentyten' ),
'name' => __( 'Fourth Footer Widget Area', 'twentyten' ),
'id' => 'fourth-footer-widget-area',
'description' => __( 'The fourth footer widget area' , 'twentyten' ),
'description' => __( 'The fourth footer widget area', 'twentyten' ),
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
'after_widget' => "</li>",
'before_title' => '<h3 class="widget-title">',
@ -375,17 +375,15 @@ add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' );
function twentyten_get_next_attachment_url() {
global $post;
$post = get_post($post);
$attachments = array_values(get_children( array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ));
$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
foreach ( $attachments as $k => $attachment )
foreach ( $attachments as $k => $attachment ) {
if ( $attachment->ID == $post->ID )
break;
$k = $k + 1;
if ( isset($attachments[$k]) ) {
return get_attachment_link($attachments[$k]->ID);
} else {
return get_permalink($post->post_parent);
}
}
$k++;
if ( isset( $attachments[ $k ] ) )
return get_attachment_link( $attachments[ $k ]->ID );
else
return get_permalink( $post->post_parent );
}

View File

@ -55,7 +55,7 @@
<?php
// Check if this is a post or page, if it has a thumbnail, and if it's a big one
if ( is_singular() &&
if ( is_singular() &&
has_post_thumbnail( $post->ID ) &&
( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail') ) &&
$image[1] >= HEADER_IMAGE_WIDTH ) :

View File

@ -1,5 +1,4 @@
<?php
/**
* The main template file
*
@ -13,7 +12,6 @@
* @subpackage Twenty Ten
* @since 3.0.0
*/
?>
<?php get_header(); ?>

View File

@ -13,7 +13,7 @@
*/
?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
@ -21,7 +21,7 @@
</div><!-- #nav-above -->
<?php endif; ?>
<?php /* If there are no posts to display, such as an empty archive page */ ?>
<?php /* If there are no posts to display, such as an empty archive page */ ?>
<?php if ( ! have_posts() ) : ?>
<div id="post-0" class="post error404 not-found">
<h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>
@ -32,10 +32,10 @@
</div><!-- #post-0 -->
<?php endif; ?>
<?php /* Start the Loop */ ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php /* How to Display posts in the Gallery Category */ ?>
<?php /* How to Display posts in the Gallery Category */ ?>
<?php if ( in_category( _x('gallery', 'gallery category slug', 'twentyten') ) ) : ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
@ -91,7 +91,7 @@
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
@ -112,7 +112,7 @@
</div><!-- #entry-utility -->
</div><!-- #post-<?php the_ID(); ?> -->
<?php /* How to display all other posts */ ?>
<?php /* How to display all other posts */ ?>
<?php else : ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
@ -136,7 +136,7 @@
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
@ -155,7 +155,7 @@
<?php endif; // if different categories queried ?>
<?php endwhile; ?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div id="nav-below" class="navigation">
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>

View File

@ -26,7 +26,7 @@
<div class="entry-meta">
<span class="meta-prep meta-prep-author"><?php _e( 'Posted on ', 'twentyten' ); ?></span>
<a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a>
<span class="meta-sep"><?php _e( ' by ', 'twentyten' ); ?> </span>
<span class="meta-sep"><?php _e( ' by ', 'twentyten' ); ?></span>
<span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span>
</div><!-- .entry-meta -->
@ -39,14 +39,14 @@
<div id="entry-author-info">
<div id="author-avatar">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
</div><!-- #author-avatar -->
</div><!-- #author-avatar -->
<div id="author-description">
<h2><?php _e( 'About ', 'twentyten' ); ?><?php the_author(); ?></h2>
<?php the_author_meta( 'description' ); ?>
<div id="author-link">
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php _e( 'View all posts by ', 'twentyten' ); ?><?php the_author(); ?> &rarr;</a>
</div><!-- #author-link -->
</div><!-- #author-description -->
</div><!-- #author-description -->
</div><!-- .entry-author-info -->
<?php endif; ?>