Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="gridContainer">
- <?php
- $c = 1; //init counter
- $bpr = 3; //boxes per row
- query_posts(
- array(
- 'posts_per_page' => 6 //put number of posts per page here
- 'paged' => (get_query_var('page')) ? get_query_var('page') : 1;
- 'cat' => 1 //ID of category to limit to here
- )
- );
- if(have_posts()) :
- while(have_posts()) :
- the_post();
- ?>
- <div class="post" id="post-<?php the_ID(); ?>">
- <h1 class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
- <div class="postImage">
- <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('grid-post-image'); ?></a>
- </div>
- <div class="postExcerpt">
- <?php the_excerpt(); ?>
- </div>
- </div>
- <?php
- if($c == $bpr) :
- ?>
- <div class="clr"></div>
- <?php
- $c = 0;
- endif;
- ?>
- <?php
- $c++;
- endwhile;
- endif;
- ?>
- <div class="clr"></div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement