Title: Conditional Image Based On Category
Last modified: August 19, 2016

---

# Conditional Image Based On Category

 *  [suntower](https://wordpress.org/support/users/suntower/)
 * (@suntower)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/conditional-image-based-on-category/)
 * Hi,
 * I’m trying to change the header image based on the Archive category.
 * I tried
 *  <?php if(strstr($category,’34’)) : ?>
 *  <img src=’[http://jchmusic.com/frametop-newsflash.gif&#8217](http://jchmusic.com/frametop-newsflash.gif&#8217);
   alt=’page header’/>
    <?php else : ?> <img src=”[http://jchmusic.com/frametop-weblog.gif&#8221](http://jchmusic.com/frametop-weblog.gif&#8221);
   alt=”page header”/> <?php endif; ?>
 * …which did nothing. So how does one capture the id or the name of the current
   category of the archive?
 * TIA,
 * —JC

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/conditional-image-based-on-category/#post-1453895)
 * is_category(’34’) (use in category archive)
    or in_category(’34’) (use in single.
   php)
 * [http://codex.wordpress.org/Conditional_Tags](http://codex.wordpress.org/Conditional_Tags)
   
   [http://codex.wordpress.org/Conditional_Tags#A_Category_Page](http://codex.wordpress.org/Conditional_Tags#A_Category_Page)
 *  Thread Starter [suntower](https://wordpress.org/support/users/suntower/)
 * (@suntower)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/conditional-image-based-on-category/#post-1453897)
 * You rawk!

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

The topic ‘Conditional Image Based On Category’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [suntower](https://wordpress.org/support/users/suntower/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/conditional-image-based-on-category/#post-1453897)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
