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

On my homepage I have a slider at the top and then three columns below that. I would like to pull the three latest post for a category in each column. So each column will have three post titles and dates for a single category.

Can anyone tell me what the Query would be?

Thanks in advance,


share|improve this question

Try this:

global $post;
$args = array( 'numberposts' => 5, 'category' => 1 );
$myposts = get_posts( $args );
foreach( $myposts as $post ) :  setup_postdata($post); ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> - <?php the_date(); ?></li>
<?php endforeach; ?>

More info: query_posts()

share|improve this answer
Thanks for the reply. I was wondering if there is a way to use category "name" not id number because for some reason my events category doesn't work. I was also wonder if there was a way to list these post titles without bullets. Thanks, 14ner – user3992 Mar 16 '11 at 18:24
@14ner category name can be easily converted to IF with get_cat_ID() function. – Rarst Mar 16 '11 at 20:46
To remove bullets, see the "Applying the CSS" section of this page of the WordPress documentation: codex.wordpress.org/Creating_Horizontal_Menus – GavinR Mar 25 '11 at 13:17

Your Answer


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