Advertisement
Guest User

basic 3 col loop

a guest
Mar 21st, 2011
2,831
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  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%; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement