WordPress.org

Ready to get started?Download WordPress

Forums

Change my background image at a curtain time in the day (2 posts)

  1. jprebul
    Member
    Posted 3 years ago #

    So I have been trying for a week to figure this out by myself and I have failed tragically multiple times. I want to change my website's background image (here)to this from midnight to 4 am every night as an easter egg. I have tried to use both php and javascript, but I have experience in neither and the results have been, as I mentioned earlier, tragic. I know a little more php then java, but any help either way would be greatly appreciated. Thank you in advance.

  2. webjunk
    Member
    Posted 3 years ago #

    Easiest probably for you to just write a shell script (if Linux/UNIX) or batch file if windows to copy whichever image you want to the destination file. Then run as a cron job at appropriate times.

    day.sh

    #!/bin/sh
    # This copies image for daytime
    cp /mydir/dayimage.png /wp-content/uploads/background.png

    night.sh

    #!/bin/sh
    # This copies image for nighttime
    cp /mydir/mightimage.png /wp-content/uploads/background.png

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.