Archived topic
How to Detect Browser?
3 replies · Started by Vish on April 5, 2018
Hello!
I am using custom CSS to show the heading in a fancy way. But it turns out that the custom CSS does not work Internet Explorer (in some old versions).
So, is there a way (PHP Code?) to detect the browser and not load that particular CSS (it is in the Additional CSS Section)?
Thanks!
You would have to use javascript. Here's an example: https://gist.github.com/ccurtin/6fb05b7739e6e538e783
Then you'd do this to your CSS:
body:not(.IE) .your-selector {
}
Forgive my ignorance but, where should I put the JavaScript? Please help!
You could put it in the wp_footer hook in GP Hooks, within these tags:
<script>
// JS in here
</script>