-1

EDIT: I also want to add that activating this plugin crashes the "Media" part of Wordpress. :D

Seriously, what am I missing here?

This is my code:

<!--[if (gte IE 6)&(lte IE 8)]>
<?php
function rw_selectivizr(){
wp_register_script('selectivizr',plugins_url('/js/selectivizr-min.js', __FILE__ ), array(), '1.0.2');
wp_enqueue_script('selectivizr');
}
add_action('wp_head', 'rw_selectivizr');
?>
<![endif]-->

I am getting the error written in the title. I don't get it... Nothing I've been able to find online has been helpful as there are no white spaces there... The other 14 plugins I've written are UTF-8 (someone suggested changing the encoding to ANSI, which I thought was a stupid suggestion... tried it anyway, didn't help)

This is all the code, I don't get it.

alarian
  • 186
  • 11

1 Answers1

0

The 46 characters are coming from the HTML conditions which will get outputed.

If you're trying to register the script if it passes the HTML browser condition, it won't work, because the PHP will be executed regardless. You should check for the browser version on the PHP side.

if(preg_match('/(?i)msie [6-8]/',$_SERVER['HTTP_USER_AGENT']))
{
    // include script
}
else
{

}
Vlad Cazacu
  • 1,520
  • 12
  • 12
  • Ok so I would have been able to properly by now if people weren't so eager on voting down my questions. So thank you, you saved my day. – alarian Aug 06 '14 at 10:13