WordPress posts on a non-WordPress page?
April 14, 2007 4:45 PM   Subscribe

Can I evoke the recent posts of a WordPress blog installed at mysite.com/blog/ to an non-WordPress PHP file such as mysite.com/index.php?

So, my site has a blog, but I dont want my entire site to be in the blog format, just the seperate folder for the blog. However I would like to display the most recent posts of my blog on my non-blog front page. I wish I knew the terminology to make this explanation easier :)

My non-blog site uses PHP (just like WordPress does) I was wondering if there was a to display/call the most recent posts from my WordPress blog @ mysite.com/blog onto my front page via mysite.com/index.php
posted by Satapher to Computers & Internet (6 answers total)
 
Haven't tried it myself, but try this plugin. There's also this more involved solution that works by polling the Wordpress database outside of Wordpress and generating the entries that way.
posted by chrominance at 4:55 PM on April 14, 2007


If all else fails you could pull in the RSS feed.
posted by null terminated at 5:00 PM on April 14, 2007


Response by poster: I found this link in the comments of chrominance's second link :

http://simplepie.org/

its a simple feed parser
posted by Satapher at 5:04 PM on April 14, 2007


Best answer: For anyone whos looking for the same solution, simplepie.org does it all and with style!
posted by Satapher at 5:43 PM on April 14, 2007


If you're more of the hand-coding type, I had to do this exact same thing for a friend. Thankfully, WP actually comes with built-in support for this feature. Here's what I came up with:

Here's my example code (disclaimer: link to a friend's site). I've marked the relevant code.

The finished page can be viewed here (same disclaimer). It pulls content from this painfully-stock WP installation (same disclaimer).

*Caveat - you need to edit the Blog Pages section in Options -> Reading in the WP admin section. The 'show at most...' setting will apply to the page you make as well as the WP default pages.
posted by mysterious1der at 6:06 PM on April 14, 2007


Response by poster: thanks mysterious1der, ive learned a lot about PHP today (i already know more than the basics)

I wanted to point out that SimplePie allows you to pull/display/format the feed from ANY website, not just your own
posted by Satapher at 7:07 PM on April 14, 2007


« Older Plan my trip!   |   which HD TFT/LCD screen to get? Newer »
This thread is closed to new comments.