I want to use dd belatedpng so the PNG’s on my website appear properly on IE. The script I’ve always used on non-wordpress websites was
<!--[if lt IE 7 ]>
<script src="js/dd_belatedpng.js"></script>
<script> DD_belatedPNG.fix('img, .ir'); </script>
<![endif]-->
Now that I need to use it on a WordPress website, I’m trying to find a way of adding that script using wp_enqueue_script (although I don’t like that system at all). At the end of the day, the theme is only going to be used on a single website, I’d prefer to hardcode the scripts path.
Anyway, is there a way of adding IE conditionals to enqueue script and or register script?
The browser detection is built into WordPress with the global variable
$is_IE
so…For the actual script you want to execute, you should probably add it to another file that is enqueued with
dd_belatedpng
as a dependency.What if you used PHP to detect the browser in the functions.php file and then put a simple if/else statement to it?