FacebookTwitter

How to Display Recent Posts in WordPress

By on Dec 14, 2010 in Wordpress Tutorials |

Share On GoogleShare On FacebookShare On Twitter

wp recent postsWordPress have lots of potential as it has wide range of codes and plugins which can be used to extend its functionality.There are many guides and tutorials are also available.

Today we come up with a snippet of code which one can use to display recent posts in wordpress.

To display recent posts in wordpress just paste the code below where you want the recent posts to appear.

<?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>

This will help you display recent posts in wordpress if you are looking for more guides related to wordperss then keep checking this blog frequently and you will find more cool tutorials and info related to wordpress.