Congratulations, you have decided to install a WordPress blog onto your site. Now you can let people know about yourself and your company, information about your products and services, and any promotions or competitions you may be running. You don’t need to post seven times a day, but one post a week is a little on the light side as search engines LOVE regularly updated content, which is what makes blogs so beneficial in your seo campaign.
But you do not want your blog to be the star of your site, you want the attention to be on the homepage. The purpose of this post is to show you how to get the most recent posts from your WordPress blog and put snippets (usually the first 30 words) onto the homepage.
The first thing we need to do is include the WordPress functions so that we can use them to pull the blogs we want. Place this code near the top of the page and definitely before the next section of code.
define("WP_USE_THEMES", false);
include("blog/wp-blog-header.php");
query_posts("showposts=3");
?>
What this block of code says is “we will format the blogs ourselves (do not include the WordPress themes), fetch all the functions that I’ll need to use WordPress here, and I want to have the 3 most recent posts”.
Now comes to fun part. We are going to do a mini-version of WordPress’s The Loop.
“The Loop is used by WordPress to display each of your posts. Using The Loop, WordPress processes each of the posts to be displayed on the current page and formats them according to how they match specified criteria within The Loop tags. Any HTML or PHP code placed in the Loop will be repeated on each post.” – WordPress Codex
<ul class="blogposts">
<?php while (have_posts()): the_post(); ?>
<li >
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p><?php the_content_rss('', false, '', 30); ?></p>
<a href="<?php the_permalink(); ?>">Read more...</a>
</li>
<?php endwhile; ?>
</ul>
</div>
In our loop, we are creating an unordered list containing the title of the post as a link, the first 30 words and a ‘read more’ link.
Obviously you style the snippets to fit into your website’s design. You can see how we have incorporated our most recent blog and news posts on our homepage.
Just like search engines, people will get bored of stale content. So by keeping fresh content on your homepage, people (as well as search engines) will be interested in visiting your site more often, and possible convert from potential customer, to paying customer.









