Title: Single post templates
Last modified: August 20, 2016

---

# Single post templates

 *  [Kristen](https://wordpress.org/support/users/kristenbrooke/)
 * (@kristenbrooke)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/single-post-templates-2/)
 * Hello,
 * I am using this solution: [http://wordpress.org/support/topic/have-a-second-singlephp-file-for-different-single-post-look?replies=29](http://wordpress.org/support/topic/have-a-second-singlephp-file-for-different-single-post-look?replies=29)
 * Like this:
 *     ```
       <?php
       $post = $wp_query->post;
       if ( in_category('5') ) {
       include("single2.php");
       } else {
       include("single1.php");
       }
       ?>
       ```
   
 * to give a different look to posts of a certain category. I need to do this for
   2 categories, not just 1. How would I add another category to this?
 * Any help is appreciated! Thanks!

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

 *  [nsathees](https://wordpress.org/support/users/nsathees/)
 * (@nsathees)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/single-post-templates-2/#post-2296704)
 * If you want different theme for both of them then use this
 * <?php
    $post = $wp_query->post; if ( in_category(‘5’) ) { include(“single2.php”);}
   elseif(in_category(‘7’)) { include(“single3.php”); } else { include(“single1.
   php”); } ?>
 *  [Jackson Whelan](https://wordpress.org/support/users/madjax/)
 * (@madjax)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/single-post-templates-2/#post-2296767)
 * You would add an elseif statement, something like this:
 *     ```
       <?php
       $post = $wp_query->post;
       if ( in_category( '5' ) ) {
           include( "single2.php" );
       } elseif( in_category( '6' ) ) {
           include( "single3.php" );
       } else {
           include( "single1.php" );
       }
       ?>
       ```
   
 *  Thread Starter [Kristen](https://wordpress.org/support/users/kristenbrooke/)
 * (@kristenbrooke)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/single-post-templates-2/#post-2296879)
 * Thank you both so much for your help!

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

The topic ‘Single post templates’ is closed to new replies.

## Tags

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

 * 3 replies
 * 3 participants
 * Last reply from: [Kristen](https://wordpress.org/support/users/kristenbrooke/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/single-post-templates-2/#post-2296879)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
