SHARE
TWEET

basic 3 col loop

a guest Mar 21st, 2011 2,363 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div id="column-wrap">  
  2.                 <?php
  3.             $count = 0;
  4.            
  5.             while(have_posts()) : the_post()          
  6.         ?>        
  7.        
  8.       <div class="box<?php if( $count%3 == 0 ) { echo '-1'; }; $count++; ?>">
  9.  
  10.       <a href="<?php the_permalink(); ?>">
  11.       <h4><?php the_title(); ?></h4></a>      
  12.       <!--and other output of the loop -->
  13.  
  14.       </div>
  15.  
  16.          <?php endwhile; ?>
  17. </div><!--end column-wrap-->
  18.  
  19. ----------------
  20. STYLES - EXAMPLE
  21.  
  22. .box-1 { float:left; clear:left; width: 30%; margin-left: 0; }
  23. .box { float:left; width: 30%; margin-left: 3%; }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top