In This Web Design post we will show you how to show wordpress posts outside of your wordpress installation.
You may have heard of third party RSS Aggregators like SimplePie and MagPie to fetch your latest posts from your blog’s RSS feed. Whilst these RSS Aggregators do the job, there’s a much easier way you can display/promote your latest and greatest blog post to local web design pages that reside outside of your WordPress installation.
With a little PHP you can simply nip into WordPress and retrieve your recent posts. As you are gaining access to all of WordPress’ functions, you have full control over how many posts to fetch and from which categories amongst other things.
| <ul> <?php require($_SERVER['DOCUMENT_ROOT'] . ‘/path/wp-load.php’); query_posts(‘showposts=15′); if (have_posts()) : while (have_posts()) : the_post(); ?> <li class=”item68″> <div align=”left”><a href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a></div> </li> <?php endwhile; else: echo “no posts”; endif; ?> <?php wp_reset_query(); ?> </ul> |
October 17, 2010





