Title: Recent post externally
Last modified: August 19, 2016

---

# Recent post externally

 *  [geoserv](https://wordpress.org/support/users/geoserv/)
 * (@geoserv)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/recent-post-externally/)
 * Using version 2.8.5
 * I am trying to display my recent blog posts on a non-Wordpress page.
 * I tried using:
 *     ```
       <?php
       require(‘./wp-blog-header.php’); // alter to path to wp-blog-header.php script on your site
       ?>
       <!– if you want to have a title graphic it goes here –>
   
       <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
   
               # <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a> <small> in <?php the_category(’, ‘) ?> &nbsp;</small><small><?php the_time(’m-d-Y’); ?> <?php the_time(’g:i a’); ?></small><br />
   
       <?php endforeach; else: ?>
       <!– put what you want here when there are no posts –>
       <?php endif; ?>
       ```
   
 * but it doesn’t display anything.
 * Is there something else that will work?
 * Thanks.

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

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/recent-post-externally/#post-1270543)
 * Here’s an example:
    [Integrating_WordPress_with_Your_Website#Last_three_posts](http://codex.wordpress.org/Integrating_WordPress_with_Your_Website#Last_three_posts)
 *  Thread Starter [geoserv](https://wordpress.org/support/users/geoserv/)
 * (@geoserv)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/recent-post-externally/#post-1270895)
 * I tried that method and received the following error:
 * `Fatal error: Call to undefined method stdClass::set_prefix() in /path/to/my/
   wp-settings.php on line 268`
 * Not sure why it would be showing wp-settings.php though.
 * Any ideas?
 *  [vanderlow](https://wordpress.org/support/users/vanderlow/)
 * (@vanderlow)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/recent-post-externally/#post-1270968)
 * The example in the Codex assumes that you are embedding wordpress directly into
   your page template.
 * A lot of people need to integrate such wordpress functionality into a CMS or 
   using a PHP framework. This usually means that the example code is added inside
   a function. The error only occurs when trying to include wordpress from inside
   a function (something needs to have global scope?).
 * I’ve been looking around for a solution, but haven’t found one anywhere. I did
   find this related big report though – it’s been assigned to 3.0:
 * [https://core.trac.wordpress.org/ticket/11066](https://core.trac.wordpress.org/ticket/11066)

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

The topic ‘Recent post externally’ is closed to new replies.

## Tags

 * [external](https://wordpress.org/support/topic-tag/external/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [vanderlow](https://wordpress.org/support/users/vanderlow/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/recent-post-externally/#post-1270968)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
