dane-m
9/5/2013 - 2:56 AM

.Untested. Should wrap javascript in ie conditional tags. Will update after testing.

.Untested. Should wrap javascript in ie conditional tags. Will update after testing.

<?php

add_action( 'wp_enqueue_scripts', 'child_add_ie_script', 200 );
/**
 * Enqueue a IE-specific style sheet (for all browsers).
 * @author Gary Jones
 * @link http://code.garyjones.co.uk/ie-conditional-style-sheets-wordpress/
 */
function child_add_ie_script() {
	
	wp_enqueue_script( 'ie-only', get_stylesheet_directory_uri() . '/js/style-ie7.js', array(), '1.0' );
	
}

add_filter( 'style_loader_tag', 'child_make_ie_script_conditional', 10, 2 );
/**
 * Add conditional comments around IE-specific script link.
 *
 * @author Gary Jones & Michael Fields (@_mfields)
 * @link http://code.garyjones.co.uk/ie-conditional-style-sheets-wordpress/
 *
 * @param string $tag    Existing script tag.
 * @param string $handle Name of the enqueued script.
 * 
 * @return string Amended markup
 */
function child_make_ie_script_conditional( $tag, $handle ) {
	
	if ( 'ie-only' == $handle )
		$tag = '<!--[if lte IE 7]>' . "\n" . $tag . '<![endif]-->' . "\n";
	
	return $tag;
	
}