Title: Lead and Previous Posts
Last modified: August 18, 2016

---

# Lead and Previous Posts

 *  [adapting](https://wordpress.org/support/users/adapting/)
 * (@adapting)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/lead-and-previous-posts/)
 * I want to display 2 lead posts with a fully summary from a specific category 
   with 4 of the most recent previous posts to be displayed below showing only titles.
 * This can be done. I used to have the code.
 * It is now being done on [http://blog.gluedideas.com/](http://blog.gluedideas.com/)
 * I have tried and tried to get the code working but I can’t. I need the code to
   display 2 or whatever other number of lead posts and differentiate them from 
   previous posts.
 * What code should I use in my loop?
 * I have managed to take some code from Glued Ideas Subtle theme, but I am pretty
   sure it needs the subtly theme to work:
 *     ```
       <!-- open loop_articles --><div id="loop_articles">
       <?php
       query_posts('category_name=events');
       if (have_posts()) :
       $iLeadIndex = 0;
       while (have_posts()) : the_post();
       $iLeadIndex++;
       $sPostClass = '';
       $bShowContent = true;
       if ($iLeadIndex <= $aOptions['lead_count']) {
       $sPostClass .= ' lead';
       $bShowContent = true;
       } else {
       $sPostClass .= ' summary';
       $bShowContent = false;
       }
       if ($iLeadIndex == $aOptions['lead_count'] + 1) {
       echo ('<h2>Previous Articles</h2>');
       }
       ?>
   
       <!-- open post --><div>
   
       <h3>
       <a href="<?php the_permalink() ?>">
       <?php the_title(); ?>
       </a>
       </h3>
   
       <?php if ($bShowContent) : ?>
   
       <!-- open content --><div class="content">
       <?php the_content(''); ?>
   
       <!-- close content --></div>
   
       <?php endif; ?>
   
       <!-- close post --></div>
   
       <?php endwhile; else: ?>
   
       <h2>Oops - There's Nothing Here</h2>
       <p>It looks like the blog owner hasn't written anything yet!</p>
   
       <?php endif; ?>
   
       <!-- close loop_articles --></div>
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [splwolf](https://wordpress.org/support/users/splwolf/)
 * (@splwolf)
 * [18 years, 9 months ago](https://wordpress.org/support/topic/lead-and-previous-posts/#post-548885)
 * I have the same problem. I’d prefer to only have the first post display a summary,
   while previous posts display titles only.
 * If the above code does accomplish this, could someone elaborate on how it does
   so? I’m not entirely ‘getting it.’
 * Thanks. 🙂
 *  [splwolf](https://wordpress.org/support/users/splwolf/)
 * (@splwolf)
 * [18 years, 9 months ago](https://wordpress.org/support/topic/lead-and-previous-posts/#post-548889)
 * I know I might be asking the question wrong, but I’m sure the idea of what I’m
   trying to do isn’t THAT out of the ordinary. Has anyone else implemented this
   on their blog?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Lead and Previous Posts’ is closed to new replies.

## Tags

 * [lead](https://wordpress.org/support/topic-tag/lead/)
 * [previous](https://wordpress.org/support/topic-tag/previous/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [splwolf](https://wordpress.org/support/users/splwolf/)
 * Last activity: [18 years, 9 months ago](https://wordpress.org/support/topic/lead-and-previous-posts/#post-548889)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
