Advertisement
Guest User

Untitled

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