Title: adding is_category to single.php
Last modified: August 20, 2016

---

# adding is_category to single.php

 *  [rebekahford](https://wordpress.org/support/users/rebekahford/)
 * (@rebekahford)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/adding-is_category-to-singlephp/)
 * Hi
 * I have 3 different post categories that I’m using to filter information on a 
   site that I’m building: project, news and events.
 * I need to display the single post differently for each type of category with 
   different things in the sidebar. Up until now I’ve been using the single post
   template plugin which works great but I was wondering whether there’s a way to
   use a conditional if (is_category(‘n’)) in the single.php somehow so that I don’t
   have to write a different template for each and more importantly my client doesn’t
   have to assign a template to their posts each time they write one.

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/adding-is_category-to-singlephp/#post-2381546)
 * please read the codex:
 * [http://codex.wordpress.org/Function_Reference/is_category](http://codex.wordpress.org/Function_Reference/is_category)
 * you might want to use:
 * `in_category()` [http://codex.wordpress.org/Function_Reference/in_category](http://codex.wordpress.org/Function_Reference/in_category)
 *  Thread Starter [rebekahford](https://wordpress.org/support/users/rebekahford/)
 * (@rebekahford)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/adding-is_category-to-singlephp/#post-2381570)
 * Yes I’m well aware of the codex as I’ve been developing WordPress sites for many
   years. I just need to know if there’s a way around this
 *  Thread Starter [rebekahford](https://wordpress.org/support/users/rebekahford/)
 * (@rebekahford)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/adding-is_category-to-singlephp/#post-2381571)
 * I’ll try in_categiry though as this might work

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

The topic ‘adding is_category to single.php’ is closed to new replies.

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [rebekahford](https://wordpress.org/support/users/rebekahford/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/adding-is_category-to-singlephp/#post-2381571)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
