Title: Category If Then Statement
Last modified: August 19, 2016

---

# Category If Then Statement

 *  Resolved [foochuck](https://wordpress.org/support/users/foochuck/)
 * (@foochuck)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/category-if-then-statement/)
 * Hello,
 * I’d like to add a function into my pages so that if the viewer is looking at 
   a category page, it will add the name of the category to the top of the page 
   header.
 * For example if the viewer is looking at this category page for ‘Episode Guide’:
   [http://www.sopranos.foochuck.com/category/episode-guide/](http://www.sopranos.foochuck.com/category/episode-guide/)
 * In the header of the page in an <h1> tag I’d like it to say, “Episode Guide”.
 * I’m just not sure what PHP markup I can use to test to see if it’s a category
   page the viewer is looking at rather than my ‘main index’ page – since they both
   run off the same .php file.
 * Thanks!

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/category-if-then-statement/#post-1415827)
 * See [Category_Templates](http://codex.wordpress.org/Category_Templates)
 *  Thread Starter [foochuck](https://wordpress.org/support/users/foochuck/)
 * (@foochuck)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/category-if-then-statement/#post-1415929)
 * Awesome. Thanks esmi.

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

The topic ‘Category If Then Statement’ is closed to new replies.

## Tags

 * [category page](https://wordpress.org/support/topic-tag/category-page/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [foochuck](https://wordpress.org/support/users/foochuck/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/category-if-then-statement/#post-1415929)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
