Title: Post template for one post?
Last modified: August 19, 2016

---

# Post template for one post?

 *  [lilqhgal](https://wordpress.org/support/users/lilqhgal/)
 * (@lilqhgal)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/post-template-for-one-post/)
 * Is it possible to make a post template to use for one post only? I want to have
   my site setup to have the 5 most recent posts displayed on the homepage, with
   the first/top one being sticky or permanent and having a different look and feel(
   like, no comments links or date etc.)… I know how to modify the theme to make
   this possible for ALL posts by modifying the single.php file but how do I do 
   this for only one post? Thanks!

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

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/post-template-for-one-post/#post-1186437)
 * I don’t understand. Do you mean you want only one specific post and only that
   one post to be formatted differently? Or do you mean that you want the top static
   post whatever it may be to be formatted differently? Or do you mean that you 
   want one post to show up on a page by itself and be formatted differently?
 *  Thread Starter [lilqhgal](https://wordpress.org/support/users/lilqhgal/)
 * (@lilqhgal)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/post-template-for-one-post/#post-1186452)
 * One post will be stickied to the homepage. That one post I want to have a different
   template/design than the rest of the posts. On all other pages, that post will
   not appear.
 *  [Mark Ratledge](https://wordpress.org/support/users/songdogtech/)
 * (@songdogtech)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/post-template-for-one-post/#post-1186491)
 * Maybe part of the solution might be [http://lorelle.wordpress.com/2007/09/06/using-wordpress-categories-to-style-posts/](https://wordpress.org/support/topic/post-template-for-one-post/using-wordpress-categories-to-style-posts?output_format=md)?
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/post-template-for-one-post/#post-1186518)
 * You can apply style conditionally using the [is_sticky()](http://codex.wordpress.org/Conditional_Tags)
   Conditional tag. Use it to add an additional class to your sticky post’s <div
   >. I kinda expected that WP would have done this but it looks like it doesn’t.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/post-template-for-one-post/#post-1186519)
 * It does if you use `<div <?php post_class();?>>` in your templates instead of`
   <div class="post">`.
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/post-template-for-one-post/#post-1186523)
 * esmi, good to know. Thanks.
 *  Thread Starter [lilqhgal](https://wordpress.org/support/users/lilqhgal/)
 * (@lilqhgal)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/post-template-for-one-post/#post-1186534)
 * Ok so using the is_sticky() how would I modify the index.php so that it says:
 * If is_sticky()
    –display THIS html–
 * else if
    –display this OTHER html–
 * I grasp the concept but I’m not 100% sure how to write the proper code. Thanks!
 *  Thread Starter [lilqhgal](https://wordpress.org/support/users/lilqhgal/)
 * (@lilqhgal)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/post-template-for-one-post/#post-1186540)
 * Nevermind I think I figured it out! So far it looks good! 🙂 Thanks for all the
   help!
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/post-template-for-one-post/#post-1186577)
 * Yes, but as esmi pointed out if you use post_class() in your templates you may
   save yourself some trouble.
 *  [frescova](https://wordpress.org/support/users/frescova/)
 * (@frescova)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/post-template-for-one-post/#post-1186637)
 * I want to do something similar but not sure how…
 * Basically I want specific posts to use specific templates.
 * Like a page would use a specific template.
    Is this possible?
 * so post id 1271 uses the custom template 1271.php
 * Make sense?
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/post-template-for-one-post/#post-1186641)
 * If you want to format some posts differently you can filter based on $post->ID
   and you wouldn’t have to actually create a new template.
 * You can also just reformat the post using CSS if you know the post IDs.
 * If you do want to use a radically different template altogether– different header,
   different footer etc– then filter based on $post->ID and redirect before get_header()
   and I think you’ll be okay. But I’ve never really thought about this before, 
   much less actually try to do it.

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

The topic ‘Post template for one post?’ is closed to new replies.

## Tags

 * [single post](https://wordpress.org/support/topic-tag/single-post/)

 * 11 replies
 * 5 participants
 * Last reply from: [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * Last activity: [16 years, 8 months ago](https://wordpress.org/support/topic/post-template-for-one-post/#post-1186641)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
