-
AuthorPosts
-
March 9, 2026 at 11:36 am #1495874
Dear team / Dear Mike,
with the a.m. post number, I raised an issue regarding layer slider visibility on mobile on my page below named first.A solution was provided regarding my request on one single page (homepage), and the result was fine
but now the presented CSS code has an unwished side effect on all other pages: All layer sliders are not visible now an all page on mobile. examplample pages see belowBy accident, I have recognized that now on ALL OTHER pages the layer sliders (different ones), doe not appear on mobile view any longer. Except on the homepage, All sliders shall be visible on all devices. “Hide on mobile” is not activated.
-> How to fix this as soon as possible? My guess is: it has to do with the numbers of the sliders maybe.
Thanks a lot and best regards, Tilman!
css entered by MIke was:
/*Homepage Slider Laptop Mobil*/
@media only screen and (min-width: 768px) {
#layer_slider_1 { display: block !important; }
#layer_slider_2 { display: none !important; }
}@media only screen and (max-width: 767px) {
#layer_slider_2 { display: block !important; }
#layer_slider_1 { display: none !important; }
}March 9, 2026 at 12:04 pm #1495876Hey oestersund,
Thank you for the update.
You’re right, the issue is that the previous css uses display: none !important; without scoping it to a specific page, so it ends up hiding #layer_slider_2 on all pages, not just the homepage.
The fix is to wrap those rules in a page-specific selector. The easiest way to do this is to use the unique body class that WordPress adds for each page. For example, if your homepage has the slug “home”, the body class would be something like page-id-123 or home. You can check the exact class by inspecting the body tag in your browser’s dev tools.
Once you have the body class for your homepage, update the css like this:
/*Homepage Slider Laptop Mobile*/ @media only screen and (min-width: 768px) { .page-id-123 #layer_slider_1 { display: block !important; } .page-id-123 #layer_slider_2 { display: none !important; } } @media only screen and (max-width: 767px) { .page-id-123 #layer_slider_2 { display: block !important; } .page-id-123 #layer_slider_1 { display: none !important; } }Replace .page-id-123 with the actual page ID class from your homepage body tag. This way the hide/show rules only apply on the homepage and all other pages with layer sliders will display normally on mobile again. This documentation should help.
— https://kriesi.at/documentation/enfold/add-custom-css/#how-to-inspect-an-element-on-the-page
Please make sure to purge the cache before testing. Let us know if the issue persists.
Best regards,
IsmaelMarch 9, 2026 at 2:26 pm #1495887Hi Ismael,
Thanks for your quick solution. Now it works like it should be :-).
Best regards , Tilman
March 9, 2026 at 10:01 pm #1495903Hi,
Glad that Ismael could help, if you have further questions please open a new thread and we will try to help. Thanks for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘layer slider visibility on mobile error / ISSUE follow up on #1495764’ is closed to new replies.
