Title: Pulling posts to different pages
Last modified: August 19, 2016

---

# Pulling posts to different pages

 *  Resolved [ger01](https://wordpress.org/support/users/ger01/)
 * (@ger01)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/pulling-posts-to-different-pages/)
 * I have a WordPress static home page, what I want to do is to display the last
   two posts from the blog page at the bottom of the homepage below other content.
 * I have searched and looked at plugins, and used yd-recent-posts widget which 
   does exactly what I want but this means that you have to put code into the content
   which can be easy deleted by mistake.
 * What is the best way of doing this?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/pulling-posts-to-different-pages/#post-1734523)
 * Could put a simple loop in your [Page Template](http://codex.wordpress.org/Pages#Page_Templates).
   The [Pages](http://codex.wordpress.org/Pages) article has some examples. Essentially
   it is something like:
 *     ```
       <?php
       $args=array(
         'post_type' => 'post',
         'post_status' => 'publish',
         'posts_per_page' => 2,
         'caller_get_posts'=> 1
       );
       $my_query = null;
       $my_query = new WP_Query($args);
       if( $my_query->have_posts() ) {
         while ($my_query->have_posts()) : $my_query->the_post(); ?>
           <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
           <?php
           the_content();
         endwhile;
       }
       wp_reset_query();  // Restore global post data stomped by the_post().
       ?>
       ```
   
 *  [elkelley](https://wordpress.org/support/users/elkelley/)
 * (@elkelley)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/pulling-posts-to-different-pages/#post-1734721)
 * Thank you I will take a look at it.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Pulling posts to different pages’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [elkelley](https://wordpress.org/support/users/elkelley/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/pulling-posts-to-different-pages/#post-1734721)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
