I have a site with WP installed at /blog, and I'd like to just get a list of the latest blog posts to display on the site home page... that is to say, my custom (PHP) home page, NOT a Wordpress page.

I found this, but it doesn't work-- the latest version of Wordpress is looking for Translate_Entry.php or some other kind of class that it can't find.

Is there an easy way to do this, short of picking up and parsing the RSS feed on the fly?

2 Answers 2


You have several options.


http://codex.wordpress.org/XML-RPC_Support is the place to start. The API exposes a large number of methods to access WordPress data "outside" of the full WordPress context. Difficult to setup, connection requests overhead.


Include wp-load.php to load up WordPress. You will need to chdir() into WordPress first for this to work properly, depending on your environments and contexts. Easy.

chdir( 'wordpress' );
require( 'wp-load.php' );
foreach ( get_posts() as $post ) {
    echo "<h2>{$post->title}</h2>";

This is very similar to the link you posted. The error you're getting is probably an include that is relative to some path. So change directories before and after.

XML feeds

Parsing the feed may be overkill, unless you cache maybe. Highly discouraged.

  • Thanks!! chdir() did it. One odd thing is that the permalink for the post is an instance variable called "guid" (i.e. $post->guid)... odd. And not in the official docs for get_posts (codex.wordpress.org/Template_Tags/get_posts) -- should I be alarmed at this?
    – Eric
    Mar 9, 2012 at 19:36
  • 1
    Glad it helped. Use get_permalink( $post->ID ) instead of guid, Note: One cannot rely upon the GUID to be the permalink (as it previously was in pre-2.5), from codex.wordpress.org/Function_Reference/get_post.
    – soulseekah
    Mar 9, 2012 at 19:43

there's a slight different version of Soulseekah's one that seems a bit better

i found it here Get user info outside Wordpress

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.