Title: Different Headers for Categories &#8211; Need Code Help
Last modified: August 18, 2016

---

# Different Headers for Categories – Need Code Help

 *  [velanche](https://wordpress.org/support/users/velanche/)
 * (@velanche)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/different-headers-for-categories-need-code-help/)
 * So I’ve ventured on my own, looking over some other postings, to construct a 
   code that I’ve placed in the header section that would pull a banner for different
   categories in a post. Once I get this to work, I also intend to modify it for
   pages, too.
 * But this is the code I’ve placed in the header section that seems to be ignored
   at the moment…
 * <div id=”header” <php if (in_category(8)) echo {‘style=”background: url([http://www.urbanlandscapes.org/wordpress/images/ul-cat-charts.png](http://www.urbanlandscapes.org/wordpress/images/ul-cat-charts.png))
   no-repeat;”‘};
    elseif(in_category(1)) echo {‘style=”background: url([http://www.urbanlandscapes.org/wordpress/images/ul-cat-news.png](http://www.urbanlandscapes.org/wordpress/images/ul-cat-news.png))
   no-repeat;”‘}; elseif(in_category(9)) echo {‘style=”background: url([http://www.urbanlandscapes.org/wordpress/images/ul-cat-playlists.png](http://www.urbanlandscapes.org/wordpress/images/ul-cat-playlists.png))
   no-repeat;”‘}; elseif(in_category(2)) echo {‘style=”background: url([http://www.urbanlandscapes.org/wordpress/images/ul-cat-reviews.png](http://www.urbanlandscapes.org/wordpress/images/ul-cat-reviews.png))
   no-repeat;”‘}; elseif(in_category(12)) echo(‘style=”background: url{http://www.
   urbanlandscapes.org/wordpress/images/ul-cat-podcasts.png) no repeat;”‘;} ?>> 
   </div>
 * I’ve moved the banner images to the same directory as the WordPress root. Other
   than that, not sure what I’m missing. Any help would be appreciated….thanks.
   
   Velanche

Viewing 1 replies (of 1 total)

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/different-headers-for-categories-need-code-help/#post-417679)
 * You may want to read these threads:
    [http://wordpress.org/support/topic/29434?replies=31](http://wordpress.org/support/topic/29434?replies=31)
   [http://wordpress.org/support/topic/30653?replies=16](http://wordpress.org/support/topic/30653?replies=16)

Viewing 1 replies (of 1 total)

The topic ‘Different Headers for Categories – Need Code Help’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [moshu](https://wordpress.org/support/users/moshu/)
 * Last activity: [19 years, 11 months ago](https://wordpress.org/support/topic/different-headers-for-categories-need-code-help/#post-417679)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
