WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to show a summary of my recent posts on my homepage. (Like the headlines and perhaps a few lines of text.) My site is not running on WordPress.

Is there a code snippet for that?


When I said "widget", I didn't mean it in the WordPress sense. I meant a code snippet.

share|improve this question
It doesn't get any better than justintadlock.com/archives/2009/03/15/… – Wyck Nov 23 '10 at 23:16
useful guide: corvidworks.com/articles/wordpress-content-on-other-pages – Tara Nov 16 '11 at 3:57

For a non-WP site, Developer's Guide - Google AJAX Feed API - Google Code is easy to use.

share|improve this answer
Um? Broken link. – Moshe Nov 24 '10 at 22:04
Didn't realize that. – markratledge Nov 25 '10 at 2:18

There is a default widget that ships with WordPress called "Recent Posts." It displays a list of titles of your recent posts.

There are also several other similar widgets with different features, some of which might allow for a few lines of text. Try searching the Plug-in Repository for "recent posts."

share|improve this answer
How can I include this in my (non-wordpress) pages? – Moshe Nov 22 '10 at 22:46
Short answer: you can't. WordPress widgets are built to be displayed in the WordPress sidebar. If you want to display a list of recent posts on a non-WordPress site, I suggest using RSS. – EAMann Nov 22 '10 at 22:56
Long answer: (assuming site does use PHP) you will need to load WP core and call separately instanced copy of widget (or mess with creating whole separate sidebar for it). In this specific scenario you are indeed better using RSS as source and whatever way to display it that non-WP site has available. – Rarst Nov 24 '10 at 6:32

If you want to publish a headline and excerpt of your latest posts on a non-WordPress, I'd use FeedBurner's BuzzBoost feature, it has always done the trick for me!

share|improve this answer

Just add the following snippet in you non-WP page:

// This is so that we can use WP functions

Now you can call wp_get_recent_posts to get the latests posts.

But reading your question agin, it seems that you are NOT using Wordpress, but you want a function similar to wordpress? In that case, you're in the wrong forum. You should ask it over at StackExchange.

And if you are not using WP, then you need to fill in more details. Are you using any CMS? IS you site custom PHP? Storing data in DB? And so on.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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