Advertisement
yashmistrey

2nd-archive-default.php

Oct 18th, 2011
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.69 KB | None | 0 0
  1. -- first loop : 1 post --      
  2.     <?php
  3.         if ( ++$count == 1 and have_posts() ):
  4.             $count = 0;
  5.             while ( have_posts() ):
  6.                 the_post(); ?>
  7.                 <a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a> <br />
  8. <br />
  9.  
  10.  
  11.     -- second loop : 2 posts --
  12.     <?php
  13.         if ( ++$count == 1 and have_posts() ):
  14.             $count = 0;
  15.             while ( have_posts() ):
  16.                 the_post(); ?>
  17.                 <a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a> <br />
  18. <br />
  19.  
  20.  
  21.                -- third loop : 3 posts --
  22.             <?php
  23.                 if ( ++$count == 3 and have_posts() ):
  24.                     $count = 0;
  25.                     while ( have_posts() ):
  26.                         the_post(); ?>
  27.                         <a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a> <br />
  28. <br />
  29.  
  30.  
  31.                        -- fourth loop : the rest --
  32.                     <?php
  33.                         if ( ++$count == 5 and have_posts() ):
  34.                             while ( have_posts() ):
  35.                                 the_post(); ?>
  36.                                 <a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a><br />
  37.  
  38.  
  39.                         <?php
  40.                              endwhile;
  41.                         else: // fourth loop has no posts
  42.                        
  43.                         endif;
  44.                     endwhile;
  45.                 else: // third loop has no posts
  46.                
  47.                 endif;
  48.             endwhile;
  49.         else: // second loop has no posts
  50.        
  51.         endif;
  52.         endwhile;
  53.     else: // first loop has no posts
  54.    
  55.     endif;
  56. ?>
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement