Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)

Two Columns

By: Digitalraindrops on Mar 1st, 2012  |  syntax: PHP  |  size: 0.64 KB  |  hits: 136  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. query_posts( $query_args );
  3. if (have_posts()) :
  4.         $postcount=0;
  5.         while (have_posts()) : the_post();
  6.                 $postcount++;
  7.         ?>
  8.         <?php if( $postcount % 2 ) : //Left Column ?>
  9.                 <div class="six columns">
  10.                         <?php get_template_part('post','loop'); ?>
  11.                 </div>
  12.         <?php else: ?>
  13.                 <div class="six columns">
  14.                         <?php get_template_part('post','loop'); ?>
  15.                 </div>
  16.                 <div class="clear"></div> <!-- Clear Both -->
  17.         <?php
  18.                 endif;
  19.         endwhile;
  20.          /* Finished on an Odd Number Add a Div and Clear */
  21.         if( $postcount % 2 ) :
  22.                 ?>
  23.                 <div class="six columns"></div><!-- Empty Box -->
  24.                 <div class="clear"></div> <!-- Clear Both -->
  25.         <?php
  26. endif;