Title: Using multiple single.php
Last modified: August 19, 2016

---

# Using multiple single.php

 *  [digitaljohn](https://wordpress.org/support/users/digitaljohn/)
 * (@digitaljohn)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/using-multiple-singlephp/)
 * You’ve all been pretty helpful so far in my questions, so thanks in advance. 
   🙂
 * Anyway, I’m developing a fairly complicated WordPress website. It has an articles
   section and a blog section. I need the articles and the blogposts to utilize 
   different forms of single.php. What I mean is, one needs to use a single.php 
   with one layout, and the other use something like a single2.php with a different
   layout.
 * I just can’t find the code snippet to do something like this. Thanks!

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

 *  [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * (@stvwlf)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/using-multiple-singlephp/#post-882986)
 * a little Google research:
 * from [http://www.webmaster-source.com/2007/11/13/wordpress-as-an-online-magazine/](http://www.webmaster-source.com/2007/11/13/wordpress-as-an-online-magazine/)
 * >  How about having different single.php templates for posts in different categories?
   > Just rename your normal single.php template to normal-single.php and create
   > as many alternate single templates as you need. Next, create a new single.php
   > and do something like this:
   > <?php
   >  $post = $wp_query->post; if (in_category(‘3’)) { include(TEMPLATEPATH.‘/
   > featuredpost-single.php’); } else { include(TEMPLATEPATH . ‘/normal-single.
   > php’); ?>
   > Using if statements, you can tell WordPress to use different templates depending
   > on the category. If you only need to make a minor tweak for a certain category,
   > you don’t need to go so far as to have a separate template. You can just put
   > <?php if (!in_category(‘3’)) { ?>
   >  Whatever you want to appear on permalink
   > pages that are not in category 3. <?php } ?>
   > I use in_category() on my single post template. That way I can cut-out some
   > of the extras if a post is in my Sideblog category.
 *  Thread Starter [digitaljohn](https://wordpress.org/support/users/digitaljohn/)
 * (@digitaljohn)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/using-multiple-singlephp/#post-883001)
 * Thanks for the solution! I tried Google, but I guess didn’t come up with good
   search terms.
 * So easy when I look at it that way… I just need to start thinking like a PHP 
   coder. Thanks again! 🙂
 *  [Jeff Golenski](https://wordpress.org/support/users/maverick3x6/)
 * (@maverick3x6)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/using-multiple-singlephp/#post-883155)
 * >  <?php if (!in_category(‘3’)) { ?>
   >  Whatever you want to appear on permalink
   > pages that are not in category 3. <?php } ?>
 * What if I would like only category 3 to display?
 *  [Jeff Golenski](https://wordpress.org/support/users/maverick3x6/)
 * (@maverick3x6)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/using-multiple-singlephp/#post-883156)
 * problem solved:
 * <?php if ( in_category(11) ) {
    echo ‘[« Return to Testimonials](http://protectyourcircle.com/testimonials/)‘;}
   else { echo ”; } ?>
 *  [Jeff Golenski](https://wordpress.org/support/users/maverick3x6/)
 * (@maverick3x6)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/using-multiple-singlephp/#post-883157)
 * problem solved:
 *     ```
       <?php if ( in_category(11) ) {
       						echo '<a href="http://protectyourcircle.com/testimonials/" title="Return to Testimonials">« Return to Testimonials</a> <br />';
       					} else {
       						echo '';
       					}
       					?>
       ```
   

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

The topic ‘Using multiple single.php’ is closed to new replies.

 * 5 replies
 * 3 participants
 * Last reply from: [Jeff Golenski](https://wordpress.org/support/users/maverick3x6/)
 * Last activity: [17 years, 2 months ago](https://wordpress.org/support/topic/using-multiple-singlephp/#post-883157)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
