Hi, I have a Soliloquy slider on a static home page (home page only). I would like to prevent this slider to show & load on mobile device (phones), I’m using the theme streamline.
Is it possible to prevent some PHP code to execute on mobile ? We also have the Zopim chat we would like to prevent from loading on phones resolution.
Please share a link to your site so I can take a look at your site.
well right now the site is back on local…. But I can paste the php here if you want to see the function.php file…
No, I wanted to check out the style sheet using Firebug. I could then target the specific areas. It’s hard to do it when you just paste the code – at least for me it is. I’ll let someone else try to help you on this then.
So all I need to know then is to find the appropriate DIV used by the slider & use “display: none” in the appropriate media query ?
Yes, that’s what I would do.
Ok, but it would still load the slider… that’s not super mobile friendly (we are trying to reduce load time on mobile device) ?
Well, I guess I answered sorta incorrectly. You would target the slider code in the CSS not the DIV.
Correct me if I’m wrong… :
The CSS load after the function.PHP code. So that mean if I prevent the slider to load using CSS, the slider would still load in the background, since it is loaded by a PHP “request”, but it just wont show since disabled at the very end by the display:none in the CSS.
We would like to completely prevent the slider from loading, from the very begining, when a mobile device (phone) is detected.
Ok, then you need one of the other more experienced PHP developers to do this for you. You can wait it out for someone to respond or maybe visit wpsites.net and see if Brad can help you.
You must be logged in to reply to this topic.
Are you a blogger, web designer, developer, or website owner looking to generate more income?
Promote products for the largest and fastest growing online website platform as part of our affiliate program.