This is a Google AMP optimized post. View the original: Random Hero Image from Directory for WordPress and Genesis. Google AMP is new technology and this post may contain tutorials with content you can't see unless you view the original, mobile page.
If you’d like to create images for a hero section of a website and put those images in a directory and have them appear as random background images that change each time a person visits a page, this is how you do it with WordPress. The more images you have, the more random it is.
If this saved you time, and I’m sure it did, consider a donation via PayPal to me@christinacreativedesign.com.
This gist has two sets of code. The first is the CSS is which is an example only. The next file is the random image php from a directory for Genesis (modifiable for any WordPress theme). Adjust as needed for your requirements.