Title: GET_POSTS
Last modified: August 18, 2016

---

# GET_POSTS

 *  [macmiller](https://wordpress.org/support/users/macmiller/)
 * (@macmiller)
 * [21 years, 8 months ago](https://wordpress.org/support/topic/get_posts/)
 * Newbie: I’m playing with getting blog extracts into a non wp page on my site (
   coolthaihouse.com). It was recommended to use get_posts. I’ve been playing with
   a small test file to see how this get_posts works. The file is at coolthaihouse/
   blog/wptest.php (and the text follows). The other php calls are just there to
   show they are ‘working’. Everything returns what it should, except the get_posts
   doesn’t seem to return anything. Can someone take a quick look at this and let
   me know what i need to do to get this to work??? and thakz….
    <?php /* Don’t 
   remove this line. */ require(‘./wp-blog-header.php’); ?> <?php bloginfo(‘info’);?
   > <?php wp_get_archives(‘monthly’,’all’,’option’,”,”,true); ?> <?php get_posts(‘
   numberposts=10&offset=1’); ?> <?php get_calendar(‘1’); ?>

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

 *  Thread Starter [macmiller](https://wordpress.org/support/users/macmiller/)
 * (@macmiller)
 * [21 years, 8 months ago](https://wordpress.org/support/topic/get_posts/#post-93712)
 * nevermind. i figured it out already! the get posts is working but doesn’t display
   until encased in something like this (as it says on the wiki)!!!!!
    -  <?php
       $posts = get_posts(‘offset=1’); foreach ($posts as $post) : ?>
    -  — <?php the_excerpt() ?>
    - <?php
       endforeach; ?>
 *  Thread Starter [macmiller](https://wordpress.org/support/users/macmiller/)
 * (@macmiller)
 * [21 years, 8 months ago](https://wordpress.org/support/topic/get_posts/#post-93713)
 * /
    -  <?php
       $posts = get_posts(‘offset=1’); foreach ($posts as $post) : ?>
    -  — <?php the_excerpt() ?>
    - <?php
       endforeach; ?>
 * /
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [21 years, 8 months ago](https://wordpress.org/support/topic/get_posts/#post-93716)
 * No need to start a new thread!
    Just continue where you’ve asked first: [http://wordpress.org/support/3/13294](http://wordpress.org/support/3/13294)
 *  Thread Starter [macmiller](https://wordpress.org/support/users/macmiller/)
 * (@macmiller)
 * [21 years, 8 months ago](https://wordpress.org/support/topic/get_posts/#post-93724)
 * yes, correct, the post should have gone to [http://wordpress.org/support/3/13294.](http://wordpress.org/support/3/13294.)
   cyber-spanking noted:) and sorry for the duplicate post here.
    the code which
   i was trying to display above (or refer to 13294) is something like this: `<?
   php $posts = get_posts('numberposts=2&offset=0'); foreach ($posts as $post) :
   start_wp(); ?>
    - <?php the_date('','','',TRUE);?>
       ["> <?php the_title() ?> ---  <?php the_excerpt()?
      >
    -  <?php
       endforeach; ?>

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

The topic ‘GET_POSTS’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [macmiller](https://wordpress.org/support/users/macmiller/)
 * Last activity: [21 years, 8 months ago](https://wordpress.org/support/topic/get_posts/#post-93724)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
