List recent posts from a single category

Adding this snippet to your wordpress theme will display the five most recent posts from a single category. Be sure to change the category name CATNAME to the category you wish to display.

 

<?php while (have_posts()) : the_post(); ?>
<li><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></li>
<?php endwhile; ?>

Leave a comment