Advertisement
Guest User

Untitled

a guest
May 19th, 2014
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div id="gridContainer">
  2. <?php
  3. $c = 1; //init counter
  4. $bpr = 3; //boxes per row
  5. query_posts(
  6.     array_merge(
  7.         $wp_query->query,
  8.         array(
  9.             'posts_per_page' => 6 //put number of posts per page here
  10.         )
  11.     )
  12. );
  13. if(have_posts()) :
  14.     while(have_posts()) :
  15.         the_post();
  16. ?>
  17.             <div class="post" id="post-<?php the_ID(); ?>">
  18.                 <h1 class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
  19.                 <div class="postImage">
  20.                     <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('grid-post-image'); ?></a>
  21.                 </div>
  22.                 <div class="postExcerpt">
  23.                     <?php the_excerpt(); ?>
  24.                 </div>
  25.             </div>
  26. <?php
  27. if($c == $bpr) :
  28. ?>
  29. <div class="clr"></div>
  30. <?php
  31. $c = 0;
  32. endif;
  33. ?>
  34. <?php
  35.         $c++;
  36.     endwhile;
  37. endif;
  38. ?>
  39. <div class="clr"></div>
  40. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement