From b1c7cbf56872585507a5fadb5f8453a86a8d21e9 Mon Sep 17 00:00:00 2001 From: dd32 Date: Sat, 11 Jun 2011 05:07:18 +0000 Subject: [PATCH] Showcase template cleanup. See #17748 git-svn-id: http://svn.automattic.com/wordpress/trunk@18269 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyeleven/showcase.php | 104 ++++++++++---------- 1 file changed, 51 insertions(+), 53 deletions(-) diff --git a/wp-content/themes/twentyeleven/showcase.php b/wp-content/themes/twentyeleven/showcase.php index 19c5b99971..69435ef32c 100644 --- a/wp-content/themes/twentyeleven/showcase.php +++ b/wp-content/themes/twentyeleven/showcase.php @@ -78,9 +78,9 @@ get_header(); ?> /** * We're going to add a class to our featured post for featured images - * by default it'll have no class though. + * by default it'll have the feature-text class. */ - $feature_class = ''; + $feature_class = 'feature-text'; if ( has_post_thumbnail() ) { // ... but if it has a featured image let's add some class @@ -94,32 +94,28 @@ get_header(); ?> // If bigger, let's add a BIGGER class. It's EXTRA classy now. $feature_class = 'feature-image large'; } - } else { - $feature_class = 'feature-text'; } - ?> - - -
- -
- - - = HEADER_IMAGE_WIDTH ) { ?> - - - - - -
+ +
+ + = HEADER_IMAGE_WIDTH ) + $thumbnail_size = 'large-feature'; + else + $thumbnail_size = 'small-feature'; + ?> + + + +
@@ -177,33 +168,40 @@ get_header(); ?> ), 'no_found_rows' => true, ); + // Our new query for the Recent Posts section. $recent = new WP_Query( $recent_args ); - $counter = 0; - while ( $recent->have_posts() ) : $recent->the_post(); + // The first Recent post is displayed normally + if ( $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; - $counter++; - if ( 1 == $counter ) : - get_template_part( 'content', get_post_format() ); - echo '
    '; + get_template_part( 'content', get_post_format() ); - else : ?> -
  1. - - - Leave a reply', 'twentyeleven' ), __( '1 Reply', 'twentyeleven' ), __( '% Replies', 'twentyeleven' ) ); ?> - -
  2. + echo '
      '; - have_posts() ) : $recent->the_post(); ?> + +
    1. + + + Leave a reply', 'twentyeleven' ), __( '1 Reply', 'twentyeleven' ), __( '% Replies', 'twentyeleven' ) ); ?> + +
    2. + + -
    + // If we had some posts, close the
      + if ( $recent->post_count > 0 ) + echo '
    '; + ?>