0
How do I use a Conditional Tag in my wordpress theme so that a certain script is not loaded on mobile devices. There is such a tag?
If there could show me an example?
In this example the script would only load at the home of the site, I would like a code that when checking that the device is mobile the script would not load. or even appear in the source code.
<?php if( is_home() ): ?>
<script data-cfasync="false" type="text/javascript" src=""></script>
<?php endif; ?>
But what makes this conditional? I need some scripts not to be loaded on mobile devices
– Endou
It checks if it’s on a mobile device, so you can check and make sure that it doesn’t load your files on Movies devices.
– Bruno Wego
shows an example of what the code would look like
– Endou
This condition is not fine-tuned, a php library can be good: http://wordpress.stackexchange.com/a/46838 - if you want to test and include in the answer, feel free :)
– brasofilo
I think the @user3192159 question is easily answered by translating the comment that is in English...
– brasofilo
Folks don’t seem to understand the question, I simply want certain script not to be loaded on mobile devices only on desktop it would be executed
– Endou