Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: in css


_ck_
Participant

@_ck_

I think you asked this on the IRC channel but I will also answer here to help others.

PHP is not processed in style.css (unless you force your server to, and that’s not recommended)

However you can edit your theme’s header.php and create an additional “inline” stylesheet like so:

<style>
body {background: url("<?php echo $_SERVER['REQUEST_URI']; ?>/wp-content/themes/default/images/background.gif") repeat-x top;}
</style>
</head>

(note that </head> at the end, it’s meant to indicate you should put that code at the end of the <head></head> section)

Also, more importantly, $_SERVER['REQUEST_URI'] is not going to be the variable you want. Probably more like $_SERVER['DOCUMENT_ROOT'] and you’ll have to add the path to wordpress too.

Skip to toolbar