recent-posts.php 881 B

12345678910111213141516171819202122232425
  1. <?php
  2. $recent = new WP_Query( array(
  3. 'posts_per_page' => 5,
  4. 'no_found_rows' => true,
  5. 'ignore_sticky_posts' => true,
  6. ) );
  7. ?>
  8. <?php if ( $recent->have_posts() ) : ?>
  9. <div id="front-page-recent-posts" class="recent-posts">
  10. <div class="recent-posts-header">
  11. <h2 class="recent-posts-title"><?php echo esc_html_e( 'Recent Posts', 'ixion' ); ?></h2>
  12. </div><!--.recent-posts-header-->
  13. <?php
  14. while ( $recent->have_posts() ) : $recent->the_post();
  15. get_template_part( 'components/features/recent-posts/content', 'recent-posts' );
  16. endwhile;
  17. wp_reset_postdata();
  18. ?>
  19. <a class="more-recent-posts" href="<?php echo esc_url( get_permalink( get_option( 'page_for_posts' ) ) ); ?>">
  20. <?php esc_html_e( 'More Posts', 'ixion' ); ?><span class="meta-nav"><?php esc_html_e( '&rarr;', 'ixion' ); ?></span>
  21. </a>
  22. </div><!--.recent-posts-->
  23. <?php endif;