Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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.
- $recent_args = array(
- 'order' => '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 '<ol class="other-recent-posts">';
- endif;
- // For all other recent posts, just display the title and comment status.
- while ( $recent->have_posts() ) : $recent->the_post(); ?>
- <li class="entry-title">
- <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
- <span class="comments-link">
- <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?>
- </span>
- </li>
- <?php
- endwhile;
- // If we had some posts, close the <ol>
- if ( $recent->post_count > 0 )
- echo '</ol>';
- ?>
- </section><!-- .recent-posts -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement