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

  1. jprebul
    Posted 4 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
    Posted 4 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.


    # 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

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.