This is the code im using in my functions file:
add_action('init', 'sort_out_jquery_pngfix_frontend');
function sort_out_jquery_pngfix_frontend() {
global $wp_scripts;
if(!is_admin()) {
wp_deregister_script('jquery');
wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', array(), NULL, true);
wp_register_script('dd_belatedpng', get_stylesheet_directory_uri() . '/js/dd_belatedpng.js', array(), NULL, true);
$wp_scripts->add_data('dd_belatedpng', 'conditional', 'lt IE 7');
}
}
add_action('wp_print_scripts', 'register_theme_scripts');
function register_theme_scripts() {
if(!is_admin()) {
wp_enqueue_script('modernizr', get_stylesheet_directory_uri() . '/js/modernizr-1.7.min.js', array(), NULL, false);
wp_enqueue_script('googlemaps', 'http://maps.google.com/maps/api/js?sensor=false', array(), NULL, true);
wp_enqueue_script('jquery');
wp_enqueue_script('dd_belatedpng');
wp_enqueue_script('sc_wc_js', get_stylesheet_directory_uri() . '/js/function.js', array('jquery', 'dd_belatedpng'), '1.0', true);
}
}
I'm using $wp_scripts->add_data('dd_belatedpng', 'conditional', 'lt IE 7');
to add a conditional statement to this script as per the documentation I can find on-line but its not working. The conditional code is not shown but the js file is.
Why is this not working?