Shopify themes, liquid, logos, and UX
I’m using the dawn theme and my website is www.blerriot.com
I was wondering if there was some code I can add or maybe in the customisation tool to allow me to have my landing page image change with every refresh to keep it fresh.
Hi @rene94
To make your landing page image change with every refresh in the Dawn theme, you can add a small JavaScript snippet to randomly select and display a different image each time the page reloads.
document.addEventListener('DOMContentLoaded', function() {
var images = [
'image1.jpg', // Add your image paths here
'image2.jpg',
'image3.jpg'
];
var randomImage = images[Math.floor(Math.random() * images.length)];
document.querySelector('.landing-page-image').style.backgroundImage = 'url(' + randomImage + ')';
});
4. Replace 'image1.jpg', 'image2.jpg', 'image3.jpg' with your actual image paths.
5. Save and refresh the page. The landing image will change on each reload.
If you have other questions, I am willing to answer them more.
Best regards,
Daisy
Hi,
it didn't work I've added that code and nothing has changed. It only shows the image that I've chosen as my image banner
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025