SHOW:
|
|
- or go back to the newest paste.
1 | <section class="recent-posts"> | |
2 | <h1 class="showcase-heading"><?php _e( 'Recent Posts', 'twentyeleven' ); ?></h1> | |
3 | ||
4 | <?php | |
5 | ||
6 | - | // Display our recent posts, showing full content for the very latest, ignoring Aside posts. |
6 | + | // Display our recent posts, ignoring Aside posts. |
7 | $recent_args = array( | |
8 | 'order' => 'DESC', | |
9 | 'post__not_in' => get_option( 'sticky_posts' ), | |
10 | 'tax_query' => array( | |
11 | array( | |
12 | 'taxonomy' => 'post_format', | |
13 | 'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-quote', 'post-format-status' ), | |
14 | 'field' => 'slug', | |
15 | 'operator' => 'NOT IN', | |
16 | ), | |
17 | ), | |
18 | 'no_found_rows' => true, | |
19 | ); | |
20 | ||
21 | // Our new query for the Recent Posts section. | |
22 | $recent = new WP_Query( $recent_args ); | |
23 | ||
24 | - | // The first Recent post is displayed normally |
24 | + | if ( $recent->have_posts() ) : |
25 | - | if ( $recent->have_posts() ) : $recent->the_post(); |
25 | + | |
26 | while ( $recent->have_posts() ) : $recent->the_post(); ?> | |
27 | - | // Set $more to 0 in order to only get the first part of the post. |
27 | + | |
28 | $more = 0; | |
29 | ||
30 | get_template_part( 'content', get_post_format() ); | |
31 | ||
32 | endwhile; endif; wp_reset_postdata(); | |
33 | - | echo '<ol class="other-recent-posts">'; |
33 | + | |
34 | </section><!-- .recent-posts --> |