Posts in two columns

Wpsnipp – Are there themes that support two or three column posts? Every two or three column theme I’ve seen really only has one column for post, and two columns. Adding this PHP code to your wordpress theme will split your posts into two columns.

 

 

     <div class="box"><?php query_posts('showposts=4'); ?><?php $hol = 1; ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if (in_category('3')) continue; ?>
<?php if (in_category('4')) continue; ?>
<?php if ($hol == 1) echo "<div class="row">"; ?>
<div class="post hol<?php echo $hol;?>" id="post-<?php the_ID(); ?>">
<?php if ( get_post_meta($post->ID, 'thumb', true) ) { ?>
<?php } else { ?>
<?php } ?>
<h2><a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<p><?php the_excerpt(); ?></p>
<?php if ($hol == 1) echo "</div>";
(($hol==1) ? $hol=2 : $hol=1); ?>
</div><!--/post-->
<?php endwhile; ?>
<?php endif; ?>

Be Sociable, Share!

Leave a comment