Changing Header Image for Category – PHP Question – I’m 75% there!!
-
OK so I’m trying to make it so that each of ten different categories has a different header image, and when it’s not on one of those categories, default back to the original (homepage) header image. Here’s where I got so far:
<div id="main_content"> <a href="<?php bloginfo('url'); ?>"><div id="header"> <?php if ( is_category(america-wants-peace) ) { ;?> <div id="headercat01"> <?php } elseif ( is_category(world-peace) ){ ;?> <div id="headercat02"> <?php } elseif ( is_category(religion-peace) ) { ;?> <div id="headercat03"> <?php } elseif ( is_category(wise-want-peace) ){ ;?> <div id="headercat04"> <?php } elseif ( is_category(non-violence-solves-problems) ) { ;?> <div id="headercat05"> <?php } elseif ( is_category(american-militarization) ){ ;?> <div id="headercat06"> <?php } elseif ( is_category(global-militarization) ) { ;?> <div id="headercat07"> <?php } elseif ( is_category(war-propaganda) ){ ;?> <div id="headercat08"> <?php } elseif ( is_category(war-economy-fails) ) { ;?> <div id="headercat09"> <?php } elseif ( is_category(war-is-hell) ){ ;?> <div id="headercat10"> <?php } else { ;?> <div id="header"> <?php } ;?> <h1></h1> <div class="description"></div> </div></a>and here’s the error code:
Parse error: syntax error, unexpected T_GLOBAL, expecting ‘)’ in /home/peacepai/public_html/test/wp-content/themes/autumn-almanac/header.php on line 38
Perhaps one of the nicer posters here could take a look at my php scripting and explain where I went wrong?
and if you want to see what i’m getting at it’s test.peacepaint.com (but none of the categories work, see above)
The topic ‘Changing Header Image for Category – PHP Question – I’m 75% there!!’ is closed to new replies.