Updated on March 10, 2020
In the comments section of Multiple Backstretched Background Images for Front Page 1 widget area of Digital Pro via Soliloquy, a user asked:
Hi,
I would love to use this method to display more background images in the Cafe Pro theme. I know you have a couple of tutorials on how to do that with a normal Soliliquy slider etc, but all those other methods mean that I have to give up on having the images fill the entire browser window. So, I figured this might be a good candidate.I have tried for a while to get this to work on the Cafe Pro, but I must obviously be missing something. Any chance we can get a new tutorial like this one, except prepared for Cafe Pro?
In this tutorial we shall
- upload the desired background images to a Soliloquy slider named say, Front Page Header
- use
soliloquy_output
filter to store the slider's images into an array - use
wp_enqueue_scripts
action hook to load Backstretch and pass the URLs of slide images to Backstretch initialization file if Front Page Header is present, otherwise the default image which can be changed in the customizer
to replace the static single background image behind the featured section (front page header) in Cafe Pro with cycling background images.
Tested in Cafe Pro 1.0.5.
Step 1
Install and activate Soliloquy (the free lite or the premium one) plugin.
Create a slider named Front Page Header
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 2
Upload jquery.backstretch.min.js to js
directory.
Create a file named say, backstretch-set.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.
What are your image size you use for this?
The same size as bg-header.jpg which comes with the theme, 2000 x 1292.
Ok, thank you!
A+ as always
What do I need to tweak to prevent this breaking other Soliloquy sliders on a site?
I have a few slider on my dev site and I make sure they have different names. I don’t see any issue with the coding for the functions or frontpage that should affect other pages.
Have you found code in this tutorial to affect other Soliloquy sliders? If so, how?
I’m having trouble getting my other sliders to show up, it seems to be outputting the expanded raw shortcode of the slider.
[“\/wp-content\/uploads\/2016\/11\/img1.jpg”,”\/wp-content\/uploads\/2016\/11\/img2.jpg”,”\/wp-content\/uploads\/2016\/11\/img3.jpg”,”\/wp-content\/uploads\/2016\/11\/img4.jpg”,”\/wp-content\/uploads\/2016\/11\/img5.jpg”]
Can you provide the URL of your site?
http://straitline.co/dee/content/sculptures/cub-scout/
The console is showing this error on those pages: TypeError: soliloquy_slider[80].getCurrentSlide is not a function
[…] 256studio on Multiple Background Images for Cafe Pro’s Front Page Header using Backstretch and Soliloquy […]
Nothing is showing up at all. I wonder if I have the .js documents in the correct location?
Can you provide the URL of your site?
Sorry, here’s the URL: http://sdhbooks.com/
I would need WP and FTP/cPanel logins to troubleshoot.
If you don’t mind, can you send me that info via https://sridharkatakam.com/contact/? Include a URL of this tutorial in the form.
Just sent.
Fixed.
I think the problem was due to corrupt js files. I have deleted jquery.backstretch.min.js and backstretch-set.js on the server and uploaded them from my computer. It’s all good now.
It works beautifully. Just what I needed. Thank you, Sir!
Terrific how-to! Great enhancement to Cafe-Pro, works perfect … THANKS!
Sridhar Katakam, I am having difficulty getting the multiple background images to load properly with the instructions provided. I have used your form to contact you. Please assist.
Hi,
I have updated the tutorial.
The change is in Step 4.