Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to put php inside of a IE conditional comments

I have a php section that loads jquery through wordpress from google's api. I dont want to load jquery on IE browsers. Long story short, it doesn't work for whatever reason (you can read through my other posted questions).

Or if this is not possible is there another way to NOT use this code when its an IE browser, maybe a php solution.

<?php 
    if( !is_admin()){
        wp_deregister_script('jquery');
        wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js', false, '1.5.2', true);
        wp_enqueue_script('jquery');
    }

?>

Targets everything except IE (what i was trying to use, but it didnt work):

<!--[if !IE]><!-->
<!--<![endif]-->
like image 802
chasethesunnn Avatar asked Nov 30 '25 14:11

chasethesunnn


1 Answers

You have the global $is_IE in Wordpress.

like image 68
Nikolay Yordanov Avatar answered Dec 03 '25 03:12

Nikolay Yordanov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!