Advertisement
Digitalraindrops

Two Columns

Mar 1st, 2012
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement