Hey Guys,
First time poster, I'm kind of a PHP n00b, I'm real good with HTML and CSS, but my employer wants me to develop our latest site with WordPress, so I guess I'm learning some PHP.
Anyway, I'm trying to switch the header image everytime the category changes. So far, the code properly places the original header on the homepage, and every category that is supposed to have a DIFFERENT header has the SAME header.
</head>
<body><div id="wrapper">
<div id="main_content">
<a href="<?php bloginfo('url'); ?>">
<?php
if ( is_category(america-wants-peace) ) {
echo('<div id="headercat01">');
}
elseif ( is_category(world-peace) ) {
echo('<div id="headercat02">');
}
elseif ( is_category(religion-peace) ) {
echo('<div id="headercat03">');
}
elseif ( is_category(wise-want-peace) ) {
echo('<div id="headercat04">');
}
elseif ( is_category(non-violence-solves-problems) ) {
echo('<div id="headercat05">');
}
elseif ( is_category(american-militarization) ) {
echo('<div id="headercat06">');
}
elseif ( is_category(world-militarization) ) {
echo('<div id="headercat07">');
}
elseif ( is_category(war-propaganda) ) {
echo('<div id="headercat08">');
}
elseif ( is_category(war-economy-fails) ) {
echo('<div id="headercat09">');
}
elseif ( is_category(war-is-hell) ) {
echo('<div id="headercat10">');
}
else {
echo('<div id="header">');
}
?>
<h1></h1>
<div class="description"></div>
</div></a>
The only one that's working is the "IF" statement, meaning that no matter which category I click on, it is currently showing me the header image for category one (america-wants-peace).
I'm pretty sure this code can't be too far off from being right. I just can't figure out what the problem is. I'd appreciate any help offered. Thanks guys.