php – Select Image from Media Library and insert into page with responsive markup
I’m building a site for my friend which uses a custom theme and no page builder. The home page has 4 splash images, and to make things as simple as possible for him I’m trying to create some functionality in the backend which will allow him to choose an image from the media library for each of the 4 locations, click save and have them displayed on the front end.
I’ve built a custom page in the admin area but am struggling with the rest. How do I:
Add 4 simple “choose media” buttons that will allow him to pick an image from the media library for each location
Save these choices in the db
Recall this from the db and display them in the front end with the default responsive wordpress markup (srcset attribute)?
I’ve been googling for hours and the closest I’ve come to a solution was this tutorial, but it’s out of date.
Thank you in advance!