This is an old version of this answer!
Return to the current answer<?php
$cats = array('1','2','3'); //enter your 3 category IDs
$num_blocks=7;
$results =array();
foreach ($cats as $cat){
query_posts('cat='.$cat.'&posts_per_page='.$num_blocks);
$i=0;
while (have_posts()): the_post();
if($i<=$num_blocks){
$results[$i][] = get_the_ID();
}
$i++;
endwhile;
wp_reset_query();
}
foreach ($results as $result){
query_posts(array('post__in'=>$result));
while (have_posts()): the_post();
?>
<div class="cats">
<li>
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<!-- <div class="post" id="post-<?php the_ID(); ?>"><?php the_excerpt(); ?></div> -->
</li>
</div>
<?php
endwhile;
echo '<hr />';
wp_reset_query();
}
?>
Monster Coder | 05/20/10 at 11:09pm





