Return to Snippet

Revision: 43297
at March 21, 2011 09:01 by sdxxx


Initial Code
<?php

date_default_timezone_set('Asia/Hong_Kong');

if( date('d m') == '01 04' ) {
  echo '<link rel="stylesheet" href="style.css" type="text/css" media="screen" />';
} else {
  echo '<link rel="stylesheet" href="style_2.css" type="text/css" media="screen" />';
}

?>

Initial URL
http://wordpress.org/support/topic/change-css-according-to-date

Initial Description
Date format guide:

d = 01 to 12 ;
m = 01 to 12 ;

More formats: http://php.net/manual/en/function.date.php

Initial Title
Change CSS according to Timezone-specific Date

Initial Tags
css

Initial Language
PHP