Title: Quick Question for Displaying Posts
Last modified: August 19, 2016

---

# Quick Question for Displaying Posts

 *  [ajwalsh](https://wordpress.org/support/users/ajwalsh/)
 * (@ajwalsh)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/quick-question-for-displaying-posts/)
 * For a (very basic) theme I’m creating, I’d like to learn how to display the whole
   post for my most recent post but then just the excerpt for subsequent posts.
 * I’ve been reading the Loop page in the codex. [http://codex.wordpress.org/The_Loop](http://codex.wordpress.org/The_Loop)
 * Would this be as simple as specifying “1 post” in the loop here? (If so, how 
   exactly would this be accomplished?)
 *     ```
       <?php while (have_posts()) : the_post(); ?>
        <?php the_content(); ?>
        <?php endwhile; ?>
       ```
   
 * Then would I reset the loop counter with rewind_posts() and do it again displaying
   the excerpts? Not really sure, but that was my guess after reading the Codex.
   I’m guessing this has been asked, but I couldn’t find it as it was difficult 
   to anticipate the exact wording that would be used.
 * Thanks for the help!

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

 *  [MAzCastro](https://wordpress.org/support/users/fmacastro/)
 * (@fmacastro)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/quick-question-for-displaying-posts/#post-1919370)
 * Hi
 * try this:
 *     ```
       <?php while (have_posts()) : the_post(); ?>
       <h1><?php the_title(); ?></h1>
       <?php  if ($count < 1) { the_content();	}
       $count = $count + 1;
       the_excerpt(); ?>
       <?php endwhile; ?>
       ```
   
 * MAC 🙂
 *  Thread Starter [ajwalsh](https://wordpress.org/support/users/ajwalsh/)
 * (@ajwalsh)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/quick-question-for-displaying-posts/#post-1919457)
 * It works for me! Thanks.
 *  Thread Starter [ajwalsh](https://wordpress.org/support/users/ajwalsh/)
 * (@ajwalsh)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/quick-question-for-displaying-posts/#post-1919461)
 * Actually, I do still have one issue. I’d like to include a link to “leave a comment”
   for the full post but “click to continue reading” for the excerpts.
 *     ```
       <?php  if ($count < 1) { the_content();	}
       $count = $count + 1;
       the_excerpt(); ?> <a href="<?php the_permalink() ?>">Click to Continue Reading</a>
       ```
   
 * This code understandably shows the “click to continue” on both. What function
   can I use to enter html into the two different PHP lines?
 *  Thread Starter [ajwalsh](https://wordpress.org/support/users/ajwalsh/)
 * (@ajwalsh)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/quick-question-for-displaying-posts/#post-1919472)
 * And also, I just noticed that this is actually displaying the excerpt after the
   full post as well.
 * Any more help would be greatly appreciated!
 *  Thread Starter [ajwalsh](https://wordpress.org/support/users/ajwalsh/)
 * (@ajwalsh)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/quick-question-for-displaying-posts/#post-1919488)
 * I have solved the issues myself. If anyone else is curious about how to do it,
   I consulted this tutorial:
 * [http://www.wprecipes.com/datadial-asked-how-can-i-display-1-full-post-and-3-excerpts](http://www.wprecipes.com/datadial-asked-how-can-i-display-1-full-post-and-3-excerpts)
 *  [MAzCastro](https://wordpress.org/support/users/fmacastro/)
 * (@fmacastro)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/quick-question-for-displaying-posts/#post-1919509)
 * I’m glad you solved your problem.
 * Indeed my code was incomplete. In a hurry I didn’t end the condition with the
   else statement.
 * It should have been like this:
 *     ```
       <?php while (have_posts()) : the_post(); ?>
       <h1><?php the_title(); ?></h1>
       <?php  if ($count < 1) { the_content();	$count = $count + 1; }
       else { the_excerpt(); }; ?>
       <?php endwhile; ?>
       ```
   
 * But in the end, both solutions use the same logic.
 * MAC 🙂

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

The topic ‘Quick Question for Displaying Posts’ is closed to new replies.

 * 6 replies
 * 2 participants
 * Last reply from: [MAzCastro](https://wordpress.org/support/users/fmacastro/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/quick-question-for-displaying-posts/#post-1919509)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
