Hi, i want to make sure that my desktop and mobile slideshows are different. is there a custom css code that can help hide the slideshow i don’t want to show on each device?
Topic summary
A Shopify user wants to display different slideshow images on desktop versus mobile devices and asks for custom CSS code to hide the unwanted slideshow on each device type.
Initial Solutions Provided:
- Multiple responders suggest using CSS media queries to hide slideshows based on screen width
- Recommended approach: Create two separate slideshow sections and add device-specific CSS to each section’s Custom CSS field
- Desktop slideshow: Hide on screens ≤749px using
@media (max-width: 749px) { slideshow-component { display: none; } } - Mobile slideshow: Hide on screens ≥750px using
@media (min-width: 750px) { slideshow-component { display: none; } }
Troubleshooting:
The user reports the CSS solutions don’t work despite following instructions and saving changes. After sharing site access (password-protected store), a helper identifies the root cause: previous edits to the slideshow.liquid file prevented custom CSS from being applied.
Resolution:
The issue was resolved by reverting the slideshow.liquid file to its original version, allowing the custom CSS code to function properly. The different slideshows now display correctly on their respective devices.
Hey @michaelafolabi9 ,
Yes, you can use custom CSS to hide specific slideshows on different devices by targeting them with media queries. Here’s how you can do it:
-
Identify the Slideshows: First, identify the unique identifiers (IDs or classes) of the slideshows you want to hide on different devices. For example, let’s assume you have two slideshows with the following classes:
-
desktop-slideshow for the desktop version.
-
mobile-slideshow for the mobile version.
-
-
Add Custom CSS: Add the following CSS code to your theme’s stylesheet(theme.css or base.css). This code will hide the desktop slideshow on mobile devices and the mobile slideshow on desktop devices.
Custom CSS Code
/* Hide desktop slideshow on mobile devices */
@media (max-width: 767px) {
.desktop-slideshow {
display: none;
}
}
/* Hide mobile slideshow on desktop devices */
@media (min-width: 768px) {
.mobile-slideshow {
display: none;
}
}
- Desktop Slideshow: The desktop-slideshow class will be hidden on devices with a screen width of 767 pixels or less (typically mobile devices).
- Mobile Slideshow: The mobile-slideshow class will be hidden on devices with a screen width of 768 pixels or more (typically desktop devices).
Adding the CSS to Your Theme1. Access Your Theme: Go to your Shopify admin panel, navigate to Online Store > Themes.
-
Edit Code: Click on Actions > Edit code for the theme you are using.
-
Add CSS: Open the assets folder and find the main CSS file (e.g., theme.css or base.css). Add the above CSS code to this file.
-
Save and Publish: Save your changes and publish the theme if necessary.
Here’s an example of how your HTML might look with the two slideshows:
<div class="desktop-slideshow">
<!-- Desktop slideshow content -->
</div>
<div class="mobile-slideshow">
<!-- Mobile slideshow content -->
</div>
Hope this helps. If you can share your slideshow code in detail I can tweak the CSS further to match your requirements ![]()
Cheers!
Shubham | Untechnickle
What theme are you using? If you use a Shopify’s free theme, follow this instruction.
Add this code to Custom CSS of the desktop slideshow to hide it on mobile
@media (max-width: 749px) {
slidehow { display: none; }
}
And this code to mobile slideshow to hide it on desktop
@media (min-width: 750px) {
slidehow { display: none; }
}
You can try to follow this step
Step 1: Go to Edit code
Step 2: Find filebase.css or theme.css and add this code at the end of the file
.slideshow {
display: none !important;
}
Best,
Esther
this doesn’t work for me
not sure why though!
Hi Shubham,
how do i find the slideshow ID?
this is my site currently
https://p49pur-te.myshopify.com/
pass: Sample2016
Still doesnt work. i currently have two slide show set up one for desktop and one for mobile
this is my site currently
https://p49pur-te.myshopify.com/
pass: Sample2016
Hi @michaelafolabi9 i see it look good
Make sure you create two slideshow sections and add code to each Custom CSS of each section
Add this code to Custom CSS of desktop slideshow section
@media (max-width: 749px) {
slideshow-component { display: none; }
}
Add to Custom CSS of mobile section
@media (min-width: 750px) {
slideshow-component { display: none; }
}
Did you click the Save button after adding the code? Also, make sure you add code to the correct sections
Yes i did that, so not really sure anymore. Nothing actually disappears.
Could you give me your collab request code so I can access your theme and check?
9123
9123
Request sent!
It’s worked now. You edited slideshow.liquid file and caused something issue with this file that caused the issue that customize CSS code is not applied. I revert the file to original version to solve it.
thanks for fixing it!!
You are very welcome!




