Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <section id="recent-posts">
- <h2 class="recent-heading"><?php _e( 'Últimos Posts', 'lonchpress' ); ?></h2>
- <?php
- // Get the page as an Object
- $recent_args = array(
- 'posts_per_page' => 4,
- 'post__not_in' => get_option( 'sticky_posts' ),
- 'public' => true,
- 'ignore_sticky_posts' => 1,
- 'post_type' => 'post'
- );
- // Our new query for the Recent Posts section.
- $recent = new WP_Query( $recent_args );
- // The first Recent post is displayed normally
- 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;
- get_template_part( 'content', 'home', get_post_format() );
- endwhile;
- echo '
- <ul class="other-recent-posts">';
- // Get the page as an Object
- $orecent_args = array(
- 'posts_per_page' => 4,
- 'offset' => 4,
- 'post__not_in' => get_option( 'sticky_posts' ),
- 'public' => true,
- 'ignore_sticky_posts' => 1,
- 'post_type' => 'post'
- );
- // Our new query for the Recent Posts section.
- $orecent = new WP_Query( $orecent_args );
- // For all other recent posts, just display the title and comment status.
- while ( $orecent->have_posts() ) : $orecent->the_post(); ?>
- <li class="entry-title">
- <h4><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'lonchpress' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h4>
- <!--<span class="comments-link">
- <?php comments_popup_link( '<span class="leave-reply">' . __( 'Deja un comentario', 'lonchpress' ) . '</span>', __( '1 comentario', 'lonchpress' ), __( '% Comentario', 'lonchpress' ) ); ?>
- </span>-->
- </li>
- <?php
- endwhile;
- Lonchpress_content_nav( 'nav-below' );
- // If we had some posts, close the <ol>
- if ( $recent->post_count > 0 )
- echo '</ul>';
- ?>
- </section><!-- .recent-posts -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement