Title: First post template
Last modified: August 19, 2016

---

# First post template

 *  [grollaz](https://wordpress.org/support/users/grollaz/)
 * (@grollaz)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/first-post-template/)
 * Hi, there is a plugin to customize only the first post of the homepage?
 * thanks

Viewing 1 replies (of 1 total)

 *  [martin.aleksander](https://wordpress.org/support/users/martinaleksander/)
 * (@martinaleksander)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/first-post-template/#post-1514146)
 * I am using this code to style the first output in a query.
 * Hopefully it will help you do what you want.. 🙂
 *     ```
       <?php query_posts(''); ?>
       <?php if ( have_posts() ) { ?>
       	<?php $post = $posts[0]; $c=0;?>
       	<ul>
       		<?php while ( have_posts() ) : the_post(); ?>
       			<?php $c++;
       			if( $c == 1) : ?><!-- The first post displays like this -->
       				<li>
       					<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
       					<?php the_excerpt(); ?>
       				</li>
       			<?php else :?> <!-- The rest of the posts -->
       				<li>
       					<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
       				</li>
       			<?php endif;?>
       		<?php endwhile; ?>
       	</ul>
       <?php } else { echo "No posts"; }?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘First post template’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [martin.aleksander](https://wordpress.org/support/users/martinaleksander/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/first-post-template/#post-1514146)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
