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?
You have several options.
XML-RPC
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.
wp-load.php
Include
wp-load.php
to load up WordPress. You will need tochdir()
into WordPress first for this to work properly, depending on your environments and contexts. Easy.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.
there’s a slight different version of Soulseekah’s one that seems a bit better
i found it here Get user info outside WordPress