Title: most recent posts
Last modified: August 19, 2016

---

# most recent posts

 *  [waveminded](https://wordpress.org/support/users/waveminded/)
 * (@waveminded)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/most-recent-posts-1/)
 * I’m using the following code below to display the 3 most recent posts from category
   4. The problem is it skipping the most recent post and displaying the 3 posts
   following the most recent??
 * <?php
    global $post; $myposts = get_posts(‘numberposts=3&offset=1&category=4’);
   foreach($myposts as $post) : setup_postdata($post); ?>
 * any suggestions???

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

 *  [Clicknathan](https://wordpress.org/support/users/clicknathan/)
 * (@clicknathan)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/most-recent-posts-1/#post-688554)
 * Try eliminating &offset=1 or changing it to &offset=2.
 * I’m not sure if that’s the solution or not as I’m not familiar with that code,
   but just glancing at it…
 *  [SimonJ](https://wordpress.org/support/users/simonj/)
 * (@simonj)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/most-recent-posts-1/#post-688557)
 * Just get rid of the “&offset=1″… Your code is asking wordpress to display 3 post
   after the first one.
 * S.
 *  Thread Starter [waveminded](https://wordpress.org/support/users/waveminded/)
 * (@waveminded)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/most-recent-posts-1/#post-688560)
 * Works like a charm! Thanks!
 *  [figuromo](https://wordpress.org/support/users/figuromo/)
 * (@figuromo)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/most-recent-posts-1/#post-688901)
 * I am using the same code, and it is calling 3 posts, but somehow is not the most
   recent 3 posts, instead it is calling the very first 3 posts.
    Does anyone know
   why??
 * The page is sitting outside the weblog directory “news” and with this code:
 *     ```
       <?php
       require('./news/wp-blog-header.php');
       ?>
   
         <?php
   
       			global $post;
        $lastposts = get_posts('numberposts=1');
        foreach($lastposts as $post) :
           setup_postdata($post);
        ?>
        <span class="greybold"><?php the_title(); ?></span>
       <?php the_content_rss('', TRUE, '', 20); ?>
        <?php endforeach; ?>
       ```
   

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

The topic ‘most recent posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 4 participants
 * Last reply from: [figuromo](https://wordpress.org/support/users/figuromo/)
 * Last activity: [17 years, 11 months ago](https://wordpress.org/support/topic/most-recent-posts-1/#post-688901)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
