Guest User

Untitled

a guest
Oct 16th, 2011
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. <!--Sets first page post limit -->
  2.  
  3. <?php
  4. if( is_home() && !is_paged() ) :
  5. global $query_string;
  6. query_posts( $query_string . '&posts_per_page=7' );
  7. endif;
  8. ?>
  9.  
  10. <!--Sets the design of the first post only -->
  11. <?php if( $counter == 0 && !is_paged() ) :
  12. $counter++; ?>
  13.  
  14. <!--Sets difference between first post and others, also sets up the grid -->
  15. <?php
  16. $c = 1; //init counter
  17. $bpr = 2; //boxes per row
  18. if(have_posts()) :
  19. while(have_posts()) :
  20. the_post();
  21. if($wp_query->current_post == 0) :
  22. ?>
  23.  
  24. <!-- markup code for first post -->
  25.  
  26.  
  27. <?php
  28. //no need to do the rest, skip to post 2
  29. continue;
  30. endif;
  31. ?>
  32.  
  33. <!-- markup code for all other posts on 1st page -->
  34.  
  35. <?php
  36. if($c == $bpr) :
  37. ?>
  38. <div class="clr"></div>
  39. <?php
  40. $c = 0;
  41. endif;
  42. ?>
  43. <?php
  44. $c++;
  45. endwhile;
  46. endif;
  47. ?>
  48.  
  49. <?php else : ?>
  50.  
  51. <!--If it is all other pages -->
  52.  
  53. <?php
  54. $c = 1; //init counter
  55. $bpr = 4; //boxes per row
  56. if(have_posts()) :
  57. while(have_posts()) :
  58. the_post();
  59. ?>
  60.  
  61. <!--Code for all other pages -->
  62.  
  63. <?php
  64. if($c == $bpr) :
  65. ?>
  66. <div class="clr"></div>
  67. <?php
  68. $c = 0;
  69. endif;
  70. ?>
  71. <?php
  72. $c++;
  73. endwhile;
  74. endif;
  75. ?>
  76. <div class="clr"></div>
  77.  
  78. <?php endif; ?>
  79. <div class="clr"></div>
  80. </div>
  81.  
  82.  
  83.  
Advertisement
Add Comment
Please, Sign In to add comment