2 replies [Last post]
zazi
zazi's picture
User offline. Last seen 2 years 26 weeks ago. Offline
rank Regular
Regular
Joined: 2007-05-18
Posts: 14
Points: 0

Hi there.....

I have the code that i am supposed to use to get a different header image for each category...

According to the author, the following code goes into the header.php file....

/* Calls the style sheets for each category */ <?php $post = $wp_query->post; if ( in_category('3') ) { include(TEMPLATEPATH . '/category3.css'); } elseif ( in_category('4') ) { include(TEMPLATEPATH . '/category4.css'); } elseif ( in_category('5') ) { include(TEMPLATEPATH . '/category5.css'); } elseif ( in_category('8') ) { include(TEMPLATEPATH . '/category8.css'); } elseif ( in_category('13') ) { include(TEMPLATEPATH . '/category13.css'); } elseif ( in_category('15') ) { include(TEMPLATEPATH . '/category15.css'); } else { include(TEMPLATEPATH . '/style.css'); } ?>

<?php /* Calls the header image for each category - necessary code */
$post = $wp_query->post;
if ( in_category('3') ) {
$imgurl = "images/category3.jpg";
} elseif ( in_category('4') ) {
$imgurl = "images/category4.jpg";
} elseif ( in_category('5') ) {
$imgurl = "images/category5.jpg";
} elseif ( in_category('8') ) {
$imgurl = "images/category8.jpg";
} elseif ( in_category('13') ) {
$imgurl = "images/category13.jpg";
} elseif ( in_category('15') ) {
$imgurl = "images/category15.jpg";
} else {
$imgurl = "images/all.jpg";
}
?>

/* Disable the header style in the individual style sheets and embed it here. */
#header {
background: url(<?php bloginfo('stylesheet_directory') ?>/<?php echo $imgurl; ?>);
height: 120px;
margin: 0 auto;
width: 100%;
padding:0;
border: 1px solid #BEBEBE; }

***This code above, was taken from this post:
http://wordpress.org/support/topic/29434?replies=31
and you can see it in action here:
http://www.jbergdesign.com/***

I want to use this code, at my own blog which is here:
[url] http://wwwza-zi.com/wordpress/ [/url]

I have attatched a text document that includes my blogs php files:
-index
-header
-page

Can someone please tell/show me exactly WHERE to put the provided code in my blog files?

thanks!

AttachmentSize
INDEX-HEADER-PAGE.txt10.44 KB
Tyssen
Tyssen's picture
User offline. Last seen 7 hours 31 min ago. Offline
rank Moderator
Moderator
Timezone: GMT+10
Joined: 2004-05-01
Posts: 7411
Points: 509

Like the author says, it

Like the author says, it goes in your header.php. It should come after the links to your other stylesheets.

How to get help
Post a link. If you can't post a link, post ALL your code, both HTML & CSS. No server-side code; just the code sent to the browser.
Use tags.
My articles | CSS Reference

zazi
zazi's picture
User offline. Last seen 2 years 26 weeks ago. Offline
rank Regular
Regular
Joined: 2007-05-18
Posts: 14
Points: 0

Sorry, i really don't know

Sorry, i really don't know much about php.... This is what is in my header....

<?php if ( is_home() ) { ?><? bloginfo('name'); ?> » <?php bloginfo('description'); ?><?php } ?>
<?php if ( is_search() ) { ?><? bloginfo('name'); ?> » Search Results<?php } ?>
<?php if ( is_single() ) { ?><? bloginfo('name'); ?> » <?php wp_title(''); ?><?php } ?>
<?php if ( is_page() ) { ?><? bloginfo('name'); ?> » <?php wp_title(''); ?><?php } ?>
<?php if ( is_category() ) { ?><? bloginfo('name'); ?> » <?php single_cat_title(); ?><?php } ?>
<?php if ( is_archive() ) { ?><? bloginfo('name'); ?> » Archive<?php } ?>
<?php if ( is_month() ) { ?><? bloginfo('name'); ?> » Archive<?php } ?>
; charset=<?php bloginfo('charset'); ?>" />

" />

" rel="stylesheet" type="text/css" />

RSS Feed" href="http://feeds.feedburner.com/feedburner/Thecraftylifewithzazi" />
" />

<?php wp_head(); ?>

But where and how do i paste the new code????