wordpress hacks

Display Recent Posts in WordPress

by Franklin Bishop on June 9, 2009

This is the easiest way to display your recent posts in WordPress. You can display recent posts using a witch if you would like or you can use this code and display it wherever you want on your blog. You can also change how many posts you want to display. It is currently set at five but you can change the number that is right after showposts.

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

You should be able to show as many recent posts as you like. I haven’t checked to see if there is a limit so I’m not completely positive. If anyone does find out how many WordPress let’s you display then let me know.

{ 2 comments }

Melvin June 10, 2009 at 2:45 am

Luckily wordpress already did that work for us…

Cara Membuat website June 15, 2009 at 11:07 am

I used to use plugin recent comments in wordpress, wordpress is great platform.

Comments on this entry are closed.

Previous post:

Next post: