WordPress How To Change My Header Depending On The Category

I am trying to change my header depending on the category. I have tried the id and the slug and for some reason it is not working. There must be something wrong with my method. I am using a if else statement.

if ( is_category('6') ) {
get_header( 'news' );}
else {
get_header();
}

I have also tried:

Read More
if ( is_category('news') ) {
get_header( 'news' );}
else {
get_header();
}

My header is named header-news.php
I was using the info from this page:

http://codex.wordpress.org/Conditional_Tags#A_Category_Page

Any help would be appreciated.

I am changing the single.php
I did first try calling the header-news.php first to make sure it works and it did, my if else statement seems to be wrong.

Related posts

Leave a Reply

2 comments