Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

Edit:

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

4 Answers 4

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. –  songdogtech 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
1  
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
require_once($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php');

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

 
discard

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.