Advertisement
Guest User

Untitled

a guest
Aug 7th, 2011
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1.         <?php $args = array(
  2.                            'showposts' => 4,
  3.                            'tag' => 'top'
  4.                            );
  5.         $topstories = new WP_Query($args);
  6.         if ($topstories->have_posts() ) : while ($topstories->have_posts() ) : $topstories->the_post(); $storycount++;
  7.        
  8.         if ($storycount == 1 ) { /* Post 1 only*/ ?>
  9.        
  10.         <div>
  11.        
  12.             <h2><?php the_title(); ?></h2>
  13.                 <?php the_excerpt(); ?>
  14.         </div>
  15.    
  16.         <?php } else { /* Posts 2-4 */?>
  17.        
  18.         <div>  
  19.             <h4><?php the_title(); ?></h4>
  20.         </div>
  21.        
  22.         </div>
  23.            
  24.         <?php } ?>
  25.         <?php endwhile; endif; ?>      
  26.            
  27.         <?php wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement