How to display wordpress posts outside the blog?
May 7th, 2010 — adminFor example, your main site is http://www.glassespeople.com ,and your blog is http://www.glassespeople.com/blog. If you want so 5 latest post description at www.glassespeople.com, how to do?
Simple, the following code will meet your needs:
// Include Wordpress
define(’WP_USE_THEMES’, false);
require(’blog/wp-load.php’);
query_posts(’showposts=5′);
?>
<?php while (have_posts()): the_post(); ?>
<h2><?php the_title(); ?></h2>
<?php the_excerpt(); ?>
<p><a href=”<?php the_permalink(); ?>”>Read more…</a></p>
<?php endwhile; ?>
copy the above code at the proper file, you can have a test also, save the code to test.php.