In the past I showed how a single random image can be pulled from images uploaded to a Soliloquy slider and set as body background using Backstretch here.
In this article I share the code for getting URLs of all images uploaded to a Soliloquy slider and passing these to Backstretch for full screen slideshow in Genesis.
Summary of steps:
- Create a "Background Images" Soliloquy slider and upload/select the desired background images.
- In a function hooked to
soliloquy_output
filter, loop through all the images in the above slider one by one, store their URLs in an array and return the array. - Enqueue Backstretch and initialize it using the above array variable (having the slide images' URLs) sent from PHP to the .js file using
wp_localize_script
.
Step 1
Install and activate Soliloquy Lite.
Step 2
Create a slider named say, "Background Images" and upload/select the desired background images. Since we are going to just use it as an easy way to manage the background images, settings in Config and Misc tabs do not matter and need not be configured.
Step 3
Add the following in child theme's functions.php:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.