Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--Sets first page post limit -->
- <?php
- if( is_home() && !is_paged() ) :
- global $query_string;
- query_posts( $query_string . '&posts_per_page=7' );
- endif;
- ?>
- <!--Sets the design of the first post only -->
- <?php if( $counter == 0 && !is_paged() ) :
- $counter++; ?>
- <!--Sets difference between first post and others, also sets up the grid -->
- <?php
- $c = 1; //init counter
- $bpr = 2; //boxes per row
- if(have_posts()) :
- while(have_posts()) :
- the_post();
- if($wp_query->current_post == 0) :
- ?>
- <!-- markup code for first post -->
- <?php
- //no need to do the rest, skip to post 2
- continue;
- endif;
- ?>
- <!-- markup code for all other posts on 1st page -->
- <?php
- if($c == $bpr) :
- ?>
- <div class="clr"></div>
- <?php
- $c = 0;
- endif;
- ?>
- <?php
- $c++;
- endwhile;
- endif;
- ?>
- <?php else : ?>
- <!--If it is all other pages -->
- <?php
- $c = 1; //init counter
- $bpr = 4; //boxes per row
- if(have_posts()) :
- while(have_posts()) :
- the_post();
- ?>
- <!--Code for all other pages -->
- <?php
- if($c == $bpr) :
- ?>
- <div class="clr"></div>
- <?php
- $c = 0;
- endif;
- ?>
- <?php
- $c++;
- endwhile;
- endif;
- ?>
- <div class="clr"></div>
- <?php endif; ?>
- <div class="clr"></div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment