In the members-only forum a user asked:
Hi Sridhar!
I’m hoping to implement the rotating slideshow of homepage background images via backstretch/soliloquy as you have with several of the Genesis child themes. My site is using the Monochrome Pro theme. Could you either refer me to the best existing tutorial (and note any modifications needed), or perhaps create a new tutorial for Monochrome?
Many thanks
This tutorial covers the steps to
- use `soliloquy_output` filter hook to check for the Front Page 1 Soliloquy slider, loop through the slide images, store all the URLs of slide images in an array and return an encoded JSON string
- load and initialize Backstretch on the homepage, use `wp_localize_script()` to pass the JSON string having slide URLs to the Backstretch initialization file.
resulting in images present in the Front Page 1 Soliloquy slider to rotate smoothly as the background for Front Page 1 section.
Step 1
Install and activate Soliloquy (free lite or the premium one) plugin.
Create a slider named Front Page 1 Slider
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/Mobile/Misc tabs do not matter and need not be configured.
Step 2
Create a file named say, backstretch-init.js in the same location having the following code:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.
Thank you Sridhar! Can you confirm where the “backstretch-init.js” file should be located? It says “in the same place” but I’m assuming that’s in the theme’s js folder? That’s where I placed it anyway.
I’m not seeing animation transitions, however my front-page-1 image is significantly “blacked out” now. I’m wondering if I used the right ID from soliloquy? I used the shortcode ID, correct?
URL is http://143.95.235.86/~hvastaging
Thanks again!
Yes to both.
I need to see inside the WordPress backend to troubleshoot this. Can you send me the site’s WP login via https://sridharkatakam.com/contact/? (don’t worry, there’s no extra charge for this)
Everything’s working great now with the updated code. Thank you Sridhar!
Fellow users, note that the CSS in step 5 includes an optional dark overlay background.
Hi,
I’ve implemented this and am trying to adjust the time length of the slide transitions via the Soliloquy settings. Should this still work as expected or not? Seems like my changes aren’t taking effect.
Thanks,
-Kent
Actually, sorry. I found those settings in the backstretch.init.js file. Duh. Thanks.