Title: Isolating a Single.php page
Last modified: August 20, 2016

---

# Isolating a Single.php page

 *  Resolved [ArdorEdor](https://wordpress.org/support/users/ardoredor/)
 * (@ardoredor)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/isolating-a-singlephp-page/)
 * I have a blog on my portfolio site that includes only one category. On the page
   for the blog there’s a sidebar where I list all of the posts sorted by their 
   title. My problem is that I can’t figure out how to isolate and style a single
   page specifically for the blog. So for example, when you click on the title on
   the sidebar it takes you to a generic single.php page, the same one used for 
   other single pages on the rest of the site.. How can I create a single page just
   for the blog. I tried calling a single-9.php to isolate the category number but
   it didn’t work. Any help would be appreciated.

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

 *  [Jackson Whelan](https://wordpress.org/support/users/madjax/)
 * (@madjax)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/isolating-a-singlephp-page/#post-2291503)
 * Try the conditional tag `in_category`
 * [http://codex.wordpress.org/Template_Tags/in_category](http://codex.wordpress.org/Template_Tags/in_category)
 *  Thread Starter [ArdorEdor](https://wordpress.org/support/users/ardoredor/)
 * (@ardoredor)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/isolating-a-singlephp-page/#post-2291600)
 * Cool thanks! Following off of the link you sent, I’m trying to “Test the current
   post outside the Loop” using this on my single.php page, but it doesn’t work:
 * <?php if ( in_category(‘news’) ) {
    include ‘single-news.php’; } else { // Continue
   with normal Loop if ( have_posts() ) : while ( have_posts() ) : the_post();?>
 *  <?php the_content(); ?>
 * Do I need to include this somewhere?:
 * <?php in_category( $category, $_post ) ?>
 *  Thread Starter [ArdorEdor](https://wordpress.org/support/users/ardoredor/)
 * (@ardoredor)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/isolating-a-singlephp-page/#post-2291610)
 * This is what I put in the loop and it doesn’t work:
 * <?php in_category( $category, $_post ) ?>
 * <?php
    if ( in_category(‘News’) ) { include ‘single-cat-9.php’; } else { // Continue
   with normal Loop if ( have_posts() ) : while ( have_posts() ) : the_post();
 * } ?>
 *  <?php the_content(); ?>
 *  <?php endwhile; ?>
    <?php endif; ?>
 *  Thread Starter [ArdorEdor](https://wordpress.org/support/users/ardoredor/)
 * (@ardoredor)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/isolating-a-singlephp-page/#post-2291636)
 * Figured it out using this widget.. Thanks!
 * [http://wordpress.org/extend/plugins/custom-post-template/](http://wordpress.org/extend/plugins/custom-post-template/)

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

The topic ‘Isolating a Single.php page’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [ArdorEdor](https://wordpress.org/support/users/ardoredor/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/isolating-a-singlephp-page/#post-2291636)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
