Support » Fixing WordPress » Change my background image at a curtain time in the day

  • jprebul


    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.

Viewing 1 replies (of 1 total)
  • webjunk


    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.

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

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

Viewing 1 replies (of 1 total)
  • The topic ‘Change my background image at a curtain time in the day’ is closed to new replies.