August 19, 2016
This technique has several advantages: first, using the background-image property is more semantic and powerful than traditional s. Second, you can have a dynamic background on an otherwise cached page. Third, you have more information available about how your user is viewing your site than just their viewport width.
The session will include three short demos: First, a basic demonstration of the technique. Second, using array_rand on the server to pull in a random background image. And as a finale, using the ambient light API in OSX Firefox to load in “day time” and “night time” images.
The addition of responsive images into the WordPress core was powerful, but it doesn’t solve every problem and isn’t always semantic.
Using AJAX to load images has many benefits because you can know more about the client.
The WordPress REST API can be used for more than you realize.