Please subscribe to my feed.

You can subscribe by entering your email address below, and you will never miss any good posts by our panel of authors. Don't worry, you can unsubscribe ANYTIME.

Should you want to join Kongtechnology.com, please read here.

WordPress is a very powerful content management system, which is specifically designed as a blogging platform. You can use WordPress as what it’s designed for, a blog, or customize it into a full fledge CMS website with the help of nothing but freely available plugins.

However what’s more common is perhaps you are installing WordPress in a sub-folder of an existing website, and after blogging for a while, you are thinking “Hey, how can I list my blog posts on my homepage?”

Latest blog posts

It’s really easy actually because WordPress has made life so much easier for us. In order to use any functions in WordPress (such as display latest blog posts, display latest comments, etc), you simply need to include the file “wp-blog-header.php”. For example, to display my latest 10 blog posts in my Flash Games page, I simply put the following few lines of code:

<?php
define(‘WP_USE_THEMES’, false);
require(‘../wp-blog-header.php’);
query_posts(‘showposts=10’);
?>

<ul>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<li><a href=”<?php the_permalink() ?>” rel=”bookmark”><?php the_title(); ?></a><br />
<?php comments_popup_link(__(‘Comments (0)’), __(‘Comments (1)’), __(‘Comments (%)’), ‘grey’); ?>
<?php endwhile; else: ?>

<?php endif; ?>
</ul>

Apart from display the latest 10 posts, it also displays the number of comments each post has.

OK, the codes above may look a little gibberish, but the important thing is by including the file “wp-blog-header.php”, you will have access to all the WordPress functions in an instant!

Wonderful isn’t it? With this you can easily integrate WordPress into your existing website and make the website easier to update by making use of WordPress CMS capability.