Twenty Eleven: strip trailing spaces, props kawauso - see #17198

git-svn-id: http://svn.automattic.com/wordpress/trunk@17714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
lancewillett 2011-04-26 18:34:52 +00:00
parent 78e15233b2
commit 972a41501e
12 changed files with 71 additions and 73 deletions

View File

@ -31,7 +31,7 @@ get_header(); ?>
<?php the_author_meta( 'description' ); ?>
</div><!-- #author-description -->
</div><!-- #entry-author-info -->
<?php endif; ?>
<?php endif; ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>

View File

@ -31,7 +31,7 @@
<div class="entry-content">
<?php if ( post_password_required() ) : ?>
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
<?php else : ?>
<?php
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
@ -44,7 +44,7 @@
<figure class="gallery-thumb">
<a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
</figure><!-- .gallery-thumb -->
<p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyeleven' ),
'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
number_format_i18n( $total_images )

View File

@ -11,7 +11,7 @@
<?php if ( 'post' == $post->post_type ) : ?>
<?php endif; ?>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( __( '<span class="leave-reply">Reply</span>', 'twentyeleven' ), __( '1', 'twentyeleven' ), __( '%', 'twentyeleven' ) ); ?>

View File

@ -28,7 +28,7 @@
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( '<span>Pages:</span>', 'twentyeleven' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<footer class="entry-meta">
<?php
$tag_list = get_the_tag_list( '', ', ' );
if ( '' != $tag_list ) {
@ -47,7 +47,7 @@
);
?>
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
<div id="author-info">
<div id="author-avatar">

View File

@ -23,7 +23,7 @@
?>
</div><!-- .entry-meta -->
<?php endif; ?>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( __( '<span class="leave-reply">Reply</span>', 'twentyeleven' ), __( '1', 'twentyeleven' ), __( '%', 'twentyeleven' ) ); ?>
@ -47,12 +47,12 @@
<span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'twentyeleven' ); ?></span><?php the_category( ', ' ); ?></span>
<?php the_tags( '<span class="sep"> | </span><span class="tag-links">' . __( 'Tagged ', 'twentyeleven' ) . '</span>', ', ', '' ); ?>
<?php endif; ?>
<?php if ( comments_open() ) : ?>
<span class="sep"> | </span>
<span class="comments-link"><?php comments_popup_link( __( '<span class="leave-reply">Leave a reply</span>', 'twentyeleven' ), __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- #entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->

View File

@ -8,29 +8,29 @@
</div><!-- #main -->
<footer id="colophon" role="contentinfo">
<?php if ( is_active_sidebar( 'sidebar-3' ) || is_active_sidebar( 'sidebar-4' ) || is_active_sidebar( 'sidebar-5' ) ) : ?>
<div id="supplementary" <?php twentyeleven_footer_sidebar_class(); ?>>
<?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
<div id="first" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-3' ); ?>
</div><!-- #first .widget-area -->
<?php endif; ?>
<?php endif; ?>
<?php if ( is_active_sidebar( 'sidebar-4' ) ) : ?>
<div id="second" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-4' ); ?>
</div><!-- #second .widget-area -->
<?php endif; ?>
<?php endif; ?>
<?php if ( is_active_sidebar( 'sidebar-5' ) ) : ?>
<div id="third" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-5' ); ?>
</div><!-- #third .widget-area -->
<?php endif; ?>
<?php endif; ?>
</div><!-- #supplementary -->
<?php endif; ?>
<div id="site-generator">
<a href="http://wordpress.org/" rel="generator">Proudly powered by WordPress</a><span class="sep"> | </span><?php printf( __( 'Theme: %1$s.', 'twentyeleven' ), 'Twenty Eleven' ); ?>
</div>

View File

@ -285,7 +285,7 @@ function twentyeleven_widgets_init() {
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => __( 'Footer Area Two', 'twentyeleven' ),
'id' => 'sidebar-4',
@ -295,7 +295,7 @@ function twentyeleven_widgets_init() {
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => __( 'Footer Area Three', 'twentyeleven' ),
'id' => 'sidebar-5',
@ -305,7 +305,6 @@ function twentyeleven_widgets_init() {
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
}
add_action( 'init', 'twentyeleven_widgets_init' );
@ -355,7 +354,7 @@ function twentyeleven_url_grabber() {
*/
function twentyeleven_footer_sidebar_class() {
$count = 0;
if ( is_active_sidebar( 'sidebar-3' ) )
$count++;
@ -364,7 +363,7 @@ function twentyeleven_footer_sidebar_class() {
if ( is_active_sidebar( 'sidebar-5' ) )
$count++;
switch ( $count ) {
case '1':
$class = 'one';
@ -377,12 +376,12 @@ function twentyeleven_footer_sidebar_class() {
case '3':
$class = 'three';
break;
default:
$class = '';
break;
}
if ( '' != $class )
echo 'class="' . $class . '"';
}
@ -411,19 +410,19 @@ function twentyeleven_comment( $comment, $args, $depth ) {
$avatar_size = 68;
if ( '0' != $comment->comment_parent )
$avatar_size = 39;
echo get_avatar( $comment, $avatar_size );
printf( __( '%1$s on %2$s%3$s at %4$s%5$s <span class="says">said:</span>', 'twentyeleven' ),
sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ),
'<a href="' . esc_url( get_comment_link( $comment->comment_ID ) ) . '"><time pubdate datetime="' . get_comment_time( 'c' ) . '">',
get_comment_date(),
get_comment_time(),
'</time></a>'
'</time></a>'
);
?>
<?php edit_comment_link( __( '[Edit]', 'twentyeleven' ), ' ' ); ?>
<?php edit_comment_link( __( '[Edit]', 'twentyeleven' ), ' ' ); ?>
</div><!-- .comment-author .vcard -->
<?php if ( $comment->comment_approved == '0' ) : ?>

View File

@ -52,7 +52,7 @@
<h1 id="site-title"><span><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1>
<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
</hgroup>
<?php
// Check to see if the header image has been removed
if ( get_header_image() != '' ) :

View File

@ -10,11 +10,11 @@ get_header(); ?>
<div id="content" role="main">
<?php the_post(); ?>
<nav id="nav-single">
<span class="nav-previous"><?php previous_image_link( false, __( '&larr; Previous' , 'twentyeleven' ) ); ?></span>
<span class="nav-next"><?php next_image_link( false, __( 'Next &rarr;' , 'twentyeleven' ) ); ?></span>
</nav><!-- #nav-single -->
</nav><!-- #nav-single -->
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
@ -70,12 +70,12 @@ get_header(); ?>
$attachment_size = apply_filters( 'theme_attachment_size', 848 );
echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height.
?></a>
<?php if ( ! empty( $post->post_excerpt ) ) : ?>
<div class="entry-caption">
<?php the_excerpt(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
</div><!-- .attachment -->
</div><!-- .entry-attachment -->

View File

@ -11,15 +11,15 @@ get_header(); ?>
<div id="primary" class="showcase">
<div id="content" role="main">
<?php the_post(); ?>
<?php
// If we have content for this page, let's display it.
if ( '' != get_the_content() )
get_template_part( 'content', 'intro' );
?>
<?php
// See if we have any sticky posts and use the latest to create a featured post
$sticky = get_option( 'sticky_posts' );
@ -27,15 +27,15 @@ get_header(); ?>
'posts_per_page' => 1,
'post__in' => $sticky,
);
$featured = new WP_Query();
$featured->query( $featured_args );
// Let's roll.
if ( $sticky ) :
$featured->the_post();
// We're going to add a class to our featured post for featured images
// by default it'll have no class though
$feature_class = '';
@ -54,7 +54,7 @@ get_header(); ?>
}
}
?>
<?php if ( has_post_thumbnail() ) : ?>
<section class="featured-post <?php echo $feature_class; ?>">
<?php else : ?>
@ -69,15 +69,15 @@ get_header(); ?>
<?php } else { ?>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_post_thumbnail( 'small-feature' ); ?></a>
<?php }
}
?>
}
?>
<?php get_template_part( 'content', 'featured' ); ?>
</section>
</section>
<?php endif; ?>
<section class="recent-posts">
<h1 class="showcase-heading"><?php _e( 'Recent Posts', 'twentyeleven' ); ?></h1>
<?php
// Display our recent posts, showing full content for the very latest, ignoring Aside posts
@ -96,17 +96,17 @@ get_header(); ?>
$recent = new WP_Query();
$recent->query( $recent_args );
$counter = 0;
while ( $recent->have_posts() ) : $recent->the_post();
// set $more to 0 in order to only get the first part of the post
global $more;
$more = 0;
$more = 0;
$counter++;
if ( 1 == $counter ) :
get_template_part( 'content', get_post_format() );
echo '<ol class="other-recent-posts">';
else : ?>
<li class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
@ -114,20 +114,20 @@ get_header(); ?>
<?php comments_popup_link( __( '<span class="leave-reply">Leave a reply</span>', 'twentyeleven' ), __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?>
</span>
</li>
<?php endif;
endwhile;
?>
</ol>
</section>
<div class="widget-area" role="complementary">
<?php if ( ! dynamic_sidebar( 'sidebar-2' ) ) : ?>
<?php
the_widget( 'Twenty_Eleven_Ephemera_Widget', '', 'before_title=<h1 class="widget-title">&after_title=</h1>' );
?>
?>
<?php endif; // end sidebar widget area ?>
</div><!-- .widget-area -->

View File

@ -25,4 +25,3 @@
<?php endif; // end sidebar widget area ?>
</div><!-- #secondary .widget-area -->

View File

@ -5,7 +5,7 @@
* @see http://codex.wordpress.org/Widgets_API#Developing_Widgets
*/
class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
/**
* Constructor
*
@ -15,18 +15,18 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
$widget_ops = array( 'classname' => 'widget_twentyeleven_ephemera', 'description' => __( 'Use this widget to list your recent Aside and Link posts', 'twentyeleven' ) );
$this->WP_Widget( 'widget_twentyeleven_ephemera', __( 'Twenty Eleven Ephemera', 'twentyeleven' ), $widget_ops );
$this->alt_option_name = 'widget_twentyeleven_ephemera';
add_action( 'save_post', array(&$this, 'flush_widget_cache' ) );
add_action( 'deleted_post', array(&$this, 'flush_widget_cache' ) );
add_action( 'switch_theme', array(&$this, 'flush_widget_cache' ) );
}
/**
* Outputs the HTML for this widget.
*
* @param array An array of standard parameters for widgets in this theme
* @param array An array of settings for this widget instance
* @param array An array of standard parameters for widgets in this theme
* @param array An array of settings for this widget instance
* @return void Echoes it's output
**/
function widget( $args, $instance ) {
@ -43,14 +43,14 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
return;
}
ob_start();
ob_start();
extract( $args, EXTR_SKIP );
$title = apply_filters( 'widget_title', empty($instance['title']) ? __( 'Ephemera' ) : $instance['title'], $instance, $this->id_base);
if ( ! isset( $instance['number'] ) )
$instance['number'] = '10';
if ( ! $number = absint( $instance['number'] ) )
$number = 10;
@ -73,33 +73,33 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
$ephemera->query( $ephemera_args );
if ( $ephemera->have_posts() ) :
echo $before_widget;
echo $before_title;
echo $title; // Can set this with a widget option, or omit altogether
echo $after_title;
global $post;
?>
<ol>
<?php while ( $ephemera->have_posts() ) : $ephemera->the_post(); ?>
<?php if ( 'aside' == get_post_format( $post->ID ) ) : ?>
<li class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
<span class="comments-link">
<?php comments_popup_link( __( '0 <span class="reply">comments &rarr;</span>', 'twentyeleven' ), __( '1 <span class="reply">comment &rarr;</span>', 'twentyeleven' ), __( '% <span class="reply">comments &rarr;</span>', 'twentyeleven' ) ); ?>
</span>
</li>
<?php elseif ( 'link' == get_post_format( $post->ID ) ) : ?>
<li class="entry-title">
<?php
$link_url = get_permalink();
if ( false != twentyeleven_url_grabber() )
$link_url = twentyeleven_url_grabber();
?>
@ -108,15 +108,15 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
<?php comments_popup_link( __( '0 <span class="reply">comments &rarr;</span>', 'twentyeleven' ), __( '1 <span class="reply">comment &rarr;</span>', 'twentyeleven' ), __( '% <span class="reply">comments &rarr;</span>', 'twentyeleven' ) ); ?>
</span>
</li>
<?php endif; ?>
<?php endwhile; ?>
</ol>
<?php
echo $after_widget;
// Reset the global $the_post as this query will have stomped on it
wp_reset_postdata();
@ -143,10 +143,10 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
return $instance;
}
function flush_widget_cache() {
wp_cache_delete( 'widget_twentyeleven_ephemera', 'widget' );
}
}
/**
* Displays the form for this widget on the Widgets page of the WP Admin area.