Different headers in Different Pages
-
I know this has been asked and I’ve gone through the other pages as well as many pages of people’s blogs explaining but it’s still not working. In fact I had it working once but I ruined it through stupidity on my part and can’t for the life of me figure out what I did last time. So here we go…
I have a website (https://www.ethansenglishcafe.com) where I am using WordPress for publishing a blog and the header has buttons, i want the button for the page currently being used to be a different colour. I’ve tried a couple different ways to no success (except once as I said).
So the header.php file has the code above and then it comes to
<?php wp_head();?>
</head>
<body <?php body_class(); ?>>
*header CSS code is here*
<hr />So I tried
<?php
if (is_page(‘forum’)) {
*forum header CSS code*;
}
else {
*Default CSS code*;
}
?>But when i load the page it wont load, just a white screen, nothing loads. I also tried to get more specific, the code I actually want to change is the buttons so I tried
<?php
if (is_page(‘forum’)) {<li><a class="current" href="*forum url*"><span>forum</a></li>
;
}
else {<li><a href="*forum url*"><span>forum</a></li>
;
}
?>which of course also didn’t work and returned a empty white page. Next I tried another technique I saw on a blog which was creating different Header pages for example “headerforum.php” and using the code below in the regular header.php to tell which one to load
<?php
if (is_page(‘slider’)){
include(TEMPLATEPATH.’/headerslider.php’);
}
elseif (is_page(‘blog’)){
include(TEMPLATEPATH.’/headerblog.php’);
}
else {
include(TEMPLATEPATH.’/headerdefault.php’);
}
?>But also gave a plain white page. I’ve been playing with this for far longer than I’d like to admit and am a little frustrated, any help?
- The topic ‘Different headers in Different Pages’ is closed to new replies.