+
+
+
+
+
+
+
+ $sticky,
+ 'post_status' => 'publish',
+ 'posts_per_page' => 10,
+ 'no_found_rows' => true,
+ );
+
+ // The Featured Posts query.
+ $featured = new WP_Query( $featured_args );
+
+ // Proceed only if published posts exist
+ if ( $featured->have_posts() ) :
+
+ /**
+ * We will need to count featured posts starting from zero
+ * to create the slider navigation.
+ */
+ $counter_slider = 0;
+
+ // Compatibility with versions of WordPress prior to 3.4.
+ if ( function_exists( 'get_custom_header' ) )
+ $header_image_width = get_theme_support( 'custom-header', 'width' );
+ else
+ $header_image_width = HEADER_IMAGE_WIDTH;
+ ?>
+
+
+
+
+ 'DESC',
+ 'post__not_in' => get_option( 'sticky_posts' ),
+ 'tax_query' => array(
+ array(
+ 'taxonomy' => 'post_format',
+ 'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-quote', 'post-format-status' ),
+ 'field' => 'slug',
+ 'operator' => 'NOT IN',
+ ),
+ ),
+ 'no_found_rows' => true,
+ );
+
+ // Our new query for the Recent Posts section.
+ $recent = new WP_Query( $recent_args );
+
+ // 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;
+
+ get_template_part( 'content', get_post_format() );
+
+ echo '
+
+
+
+
+
+
+
+ have_posts() ) : $featured->the_post();
+
+ // Increase the counter.
+ $counter_slider++;
+
+ /**
+ * We're going to add a class to our featured post for featured images
+ * by default it'll have the feature-text class.
+ */
+ $feature_class = 'feature-text';
+
+ if ( has_post_thumbnail() ) {
+ // ... but if it has a featured image let's add some class
+ $feature_class = 'feature-image small';
+
+ // Hang on. Let's check this here image out.
+ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) );
+
+ // Is it bigger than or equal to our header?
+ if ( $image[1] >= $header_image_width ) {
+ // If bigger, let's add a BIGGER class. It's EXTRA classy now.
+ $feature_class = 'feature-image large';
+ }
+ }
+ ?>
+
+
+
+ = $header_image_width )
+ $thumbnail_size = 'large-feature';
+ else
+ $thumbnail_size = 'small-feature';
+ ?>
+
+
+
+
+
+
+ post_count > 1 ) :
+ ?>
+
+
+
+
+
+
+ - ';
+
+ endif;
+
+ // For all other recent posts, just display the title and comment status.
+ while ( $recent->have_posts() ) : $recent->the_post(); ?>
+
+
- + + + ' . __( 'Leave a reply', 'twentyeleven' ) . '', __( '1 Reply', 'twentyeleven' ), __( '% Replies', 'twentyeleven' ) ); ?> + + + + + if ( $recent->post_count > 0 ) + echo '