Two columns of posts: one of a certain category, one not?
-
I’d like to have two columns of excerpts on my template: one displaying excerpts from the last N posts of category X, the other displaying excerpts from the last N posts of everything BUT category X. Here’s all I’ve been able to come up with thus far:
<?php $my_query = new WP_Query('category_name=podcast&showposts=3');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;?>
<div class="post" id="post-<?php the_ID(); ?>">
<div class="entry">
<?php the_excerpt(); ?>
</div>
</div>
<?php endwhile; ?>
<?php if (have_posts()) : while (have_posts()) : the_post();
if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<div class="entry">
<?php the_excerpt(); ?>
</div>
</div>
<?php endwhile; endif; ?>Clearly, that’s not going to work, but handling multiple loops is above my head at the moment. Help?!
- The topic ‘Two columns of posts: one of a certain category, one not?’ is closed to new replies.