Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Cold Iron Chef on "Adding an alternate header (PHP question)"

$
0
0

Hi,

I am editing the Tempera theme to have an alternate header on certain pages. I have succeeded thus far in finding the bit of PHP that lets me control that (in header.php), and wrote a bit of code to successfully insert my own code on select pages. I'm not very good at PHP (I'm still learning). This is what I've got so far, this works, except for the homepage.

<?php
if (is_page(array('38', '344', '498', '26', '48', '491')))
{
echo '<h1 class="customheadertitle">Services Sociaux</h1><h2 class="customheadertagline">pour personnes âgées 50 ans+</h2>';
}
?>
<?php
if (is_page(array('338', '54', '56')))
{
echo '<h1 class="customheadertitle">Programmes</h1><h2 class="customheadertagline">pour personnes âgées 50 ans+</h2>';
}
?>
<?php
if (is_page(array('352', '360', '367')))
{
cryout_branding_hook();
}
?>

What I would like my code to do is this:

If pages x,y,z etc... are being viewed, display Code A
If pages u,v,w etc... are being viewed, display Code B
If viewing any other page not listed above, then display default header ( cryout_branding_hook(); ).

I can't seem to get elseif statements to work for me, so I must be doing something wrong.

What is the proper code for doing what I want?

Thank you!


Viewing all articles
Browse latest Browse all 8245

Trending Articles