Display Latest posts

by MD on 2010/05/12

Here is the code to display latest four posts in self hosted WordPress blog.

<?php query_posts('showposts=4'); ?>
    <ul> <?php while (have_posts()) : the_post(); ?>
        <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li><?php endwhile; ?>
    </ul>

You may also like:

Leave a Comment

Previous post:

Next post: