Want more features on Pastebin? Sign Up, it's FREE!
Guest

two col loop

By: alchymyth on Mar 1st, 2012  |  syntax: PHP  |  size: 0.57 KB  |  views: 255  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. query_posts( $query_args );
  2. if (have_posts()) :
  3. echo '<div class="six columns">';
  4. while (have_posts()) : the_post();
  5. $postcount++;
  6. if( ($postcount % 2) == 1 ) : // skip 'even' posts
  7.        
  8.         else :
  9.                                
  10.                 include('post-loop.php');
  11.                                
  12.         endif;
  13. endwhile;
  14.        
  15. echo '</div> <!-- end first column -->';
  16. $postcount = 0;
  17. rewind_posts();
  18. echo '<div class="six columns"> <!-- start second column -->';
  19. while(have_posts()) : the_post();
  20. $postcount++;
  21. if( ($postcount % 2) != 1 ) : // skip 'odd' posts
  22.        
  23.         else :
  24.                                
  25.                 include('post-loop.php');
  26.                                
  27.         endif;
  28. endwhile;
clone this paste RAW Paste Data