WP-Clock Image Rotator
Provide the ability to change an image depending on the your local time. Note: I’m currently using it for my header image, thats why you might see me in my PJ’s.
Note: This is a beta version. All feedback and contributions appreciated. Use at own risk, works for me though.
Install Instruction
0. Backup and files before you change them!
1. Unzip the package and copy the file “clockrotator.php” to your wordpress-plugin directory. e.g. /wordpress/wp-content/plugins.
2. Upload the images you want to change depending on the time to your themes image folder. e.g. /wordpress/wp-content/themes/yourthemename/images. Tip. Keep a standard naming style. For example if you want ot rotate the header use meaningful names. e.g. header_morning.jpg, header_night.jpg
3. Then go to admin-panel -> plugins, find the ‘Clock Image Rotator’, and click ‘edit’. You then need to change the image names to those you uploaded above.
4. Then go to Presentation > Themes Editor in the admin section, and select the file containing the image you want to chance. It could be a little tricky figureing out where the image is called that appears on your theme. But a bit of patience and you will find it. When you do you need to replace the image name with a snip of php code. e.g.
with:
Note: The you just have to replace the directory/image_name with ‘ . get_bg_image()’ and check that the php tags only open and close once.
5. Then activate the plugin via the admin-panel -> plugins.
6. Check that one of the image you listed comes up when you visit your site.
7. If an image is displaying, however it is out of sync with your local time. Go back to admin-panel -> plugins, find the ‘Clock Image Rotator’, and click ‘edit’. Chance the line 39(ish) $hour = date(’G') + 8, to reflect the the correct offset. That is change the 8 to whatever will make the correct image come up depending on you local time. (Its basic maths).
Note: I’m sure there is a better way to calculate the offset and am open to ideas.
Download:
You can download WP-Clock Image Rotator version 0.1 here.
Credits:
Code was also used from Roy Schestowitz who can be found at http://schestowitz.com. Thanks Roy.
Feedback:
For errors, feedback, tips… please use the comments section below (www.madteckhead.com/wp-clock-image-rotator/).


September 16th, 2007 at 3:46 am
Sorry to say that due to times constraints imposed on my by the creator(s), namely 24 hour days and the daily requirement for sleep, this project is no longer under active development.
If you really want me to work on it, by all means let me know and I’ll reconsider.
Nathan