So if I have a simple loop like this: How would I go about outputting posts in different columns? Like odd/even posts going into a left and right column (for styling purposes).
I can write a filter to add the classes to each consecutive post, but then I'd need to overwrite them in css on the single/archive pages. I figure there's got to be a better way to do it in the html structure.
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('posts_per_page=3&paged=' . $paged);
?>
<?php if (have_posts()) : while ( have_posts()) : the_post(); ?>
<div <?php post_class('clearfix') ?> id="post-<?php the_ID(); ?>">
<span><?php the_time('M jS, Y') ?></span>
<?php echo '<em>Written by </em> <br>'; the_author_posts_link(); ?>
<?php the_tags('Tags: ', ', ', '<br />'); ?>
<?php comments_popup_link('No Comments', '1 Comment', '% Comments', 'comments-link', ''); ?>
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<?php global $more; $more = 0; ?>
<?php the_post_thumbnail(); ?>
<?php the_content('Read on...'); ?>
<?php endwhile; endif; ?>