Display Recent Posts

Send Snippet To: Save this snippet to Code Collector Pro -- view all maeghan's snippets
language: PHP
license: BSD

Code for Snippet:

                
Display Recent Posts
 
Here is the code you need to display the most recent 5 posts:
 
 
<?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>
comments powered by Disqus

Info

Tags: wordpress

Link to this snippet:


Download to Code Collector

To use the direct link to your snippet on CodeCollector.net either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 701
Date Added: 2009-04-27 23:41:19
Last Modified: 0000-00-00 00:00:00

Web Analytics