diff backgrounds with diff categories

place this code in header

<?php

 

if(is_category(7) || is_category(‘super-food’) || post_is_in_descendant_category( 7 )) {

$body_bg = ‘http://frommotherearthtoyou.com/wp-content/uploads/super-food-bg3.jpg&#8217;;

} elseif(is_category(1) || is_category(‘super-herbs’) || post_is_in_descendant_category( 1 )) {

$body_bg = ‘http://frommotherearthtoyou.com/wp-content/uploads/super-herbs-bg.jpg&#8217;;

} elseif(is_category(8) || is_category(‘super-minerals’) || post_is_in_descendant_category( 8 )) {

$body_bg = ‘http://frommotherearthtoyou.com/wp-content/uploads/super-minerals-bg2.jpg&#8217;;

} else {

$body_bg = ”;

}

if($body_bg != ”) : ?>

<style type=”text/css”>

body { background:url(‘<?php echo $body_bg; ?>’) no-repeat top center !important; }

</style>

<?php endif; ?>

Advertisements
This entry was posted in Wordpress. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s