Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 112466

alchymyth on "PHP/echo in CSS"

$
0
0

I wouldn't have to do it to each template file

you would do it generally just in header.php;

example:

<style type="text/css" media="screen">
#header {
        background: <?php
$time = intval(date('Hi'));
if ( ($time>800) && ($time<=2000) )
{
   echo '#fff';
}
else
{
   echo '#000';
}
?>;
}
</style>

if I update the theme, I wouldn't have to do it all over again.

either work with a child theme;
http://codex.wordpress.org/Child_Themes

or in extreme create a plugin for this and enqueue the styles; http://codex.wordpress.org/Plugin_API
http://codex.wordpress.org/Function_Reference/wp_enqueue_style


Viewing all articles
Browse latest Browse all 112466

Trending Articles