WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the Modest theme from elegant themes at http://lilsaintz.co.nz

Under the slider on the homepage, there are three content areas that are generated from pages.

I would like to make one of the content areas a "Latest News" element showing the last 5 posts from the blog (category = blog).

Bearing in mind that I am a complete WP novice - although I am really good at following instructions :) - what would be the best way to go about doing this?

Thank you!

share|improve this question

Probably the get_posts tag. It's simple, you just need a loop.

   $args = array( 'numberposts' => 5, 'cat' => 5 );
   $postslist = get_posts( $args );
   foreach ($postslist as $post) :  setup_postdata($post); ?> 
    <?php the_date(); ?>
    <br />
    <?php the_title(); ?>   
    <?php the_excerpt(); ?>
<?php endforeach; ?>

That will show the last 5 posts from the category with ID 5. Complete parameters list.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.