Ok I am trying to have a custom header be displayed when viewing a post within certain categories.
I seem to only find instructions on how to display custom headers on the actual category pages.
I have tried this code with no luck:
<?php
if ( is_category('7') ) :
get_header('freelance');
elseif ( is_category('17') ) :
get_header('freelance');
elseif ( is_category('18') ) :
get_header('freelance');
elseif ( is_category('19') ) :
get_header('freelance');
elseif ( is_category('20') ) :
get_header('freelance');
elseif ( is_category('21') ) :
get_header('freelance');
elseif ( is_category('22') ) :
get_header('freelance');
elseif ( is_category('23') ) :
get_header('freelance');
elseif ( is_category('24') ) :
get_header('freelance');
else :
get_header();
endif;
?>
I have also tried the same code with the slugs:
<?php
if ( is_category('support') ) :
get_header('freelance');
elseif ( is_category('domain') ) :
get_header('freelance');
elseif ( is_category('email') ) :
get_header('freelance');
elseif ( is_category('file-management') ) :
get_header('freelance');
elseif ( is_category('godaddy') ) :
get_header('freelance');
elseif ( is_category('justhost') ) :
get_header('freelance');
elseif ( is_category('wordpress') ) :
get_header('freelance');
elseif ( is_category('xhtml-css-php') ) :
get_header('freelance');
elseif ( is_category('troubleshooting') ) :
get_header('freelance');
else :
get_header();
endif;
?>
Am I simply doing something wrong? Or does this not work at all?
Thanks in advance!