WordPress – Display the most Recent Post from a Specific Category

Did you see sites with a magazine style theme who are displaying posts from a specific category. Sometimes only the most recent post.

Well you can do this too easily.

  while(have_posts()) : the_post();
    <li><h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>

    <ul><li><?php the_content(); ?></li>
<?php endwhile; ?> 

Add the above code anywhere you like in the template.
Make sure you change the category ID and you can change the number of posts displayed as well if you want.

Leave a Reply

Your email address will not be published. Required fields are marked *