Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: deepbevel on Feb 20th, 2012  |  syntax: None  |  size: 0.72 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php query_posts( array('posts_per_page' => -1,  'cat' => '3', ));
  2.  
  3.  while ( have_posts() ) : the_post();
  4. $counter++; // add +1 to count for each post
  5. ?>
  6.  
  7.  
  8.  
  9.  
  10. <?php    
  11. if($counter===1) {
  12.  
  13. ?>
  14.  
  15.                                        
  16.  
  17. <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  18.  
  19. <?php the_content();
  20.  
  21.  
  22.  
  23.  
  24.  
  25. } else { ?>
  26.        
  27.  
  28.  
  29.  
  30.  
  31.  
  32. <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  33.  
  34. <?php the_excerpt();?>
  35.  
  36.  
  37. <?php
  38.  
  39. }
  40. ?>
  41.  
  42.  
  43.  
  44.  
  45. <?php endwhile;?>
  46.  
  47.  
  48.  
  49. <div class="navigation"><p><?php posts_nav_link(); ?></p></div>
  50.  
  51.  
  52.  
  53. <?php
  54. wp_reset_query();?>