Don’t use query_posts
– it’s can really mess things up. Instead, use three WP_Query
instances:
$post_from_cat_a = new WP_Query(array(
'category__name' => array('a'), //Get posts from category a
'posts_per_page'=> 1 //Limit it to the latest one
));
if( $post_from_cat_a->have_posts() ){
while( $post_from_cat_a->have_posts() ): $post_from_cat_a->the_post();
//Display output here for post from category a
endwhile;
}
$post_from_cat_b = new WP_Query(array(
'category__name' => array('b'),
'posts_per_page'=> 1
));
if( $post_from_cat_b->have_posts() ){
...
...
//and so on :)