Created
          October 12, 2011 23:15 
        
      - 
      
- 
        Save peterwilsoncc/1282923 to your computer and use it in GitHub Desktop. 
    Conditional commented JavaScript in WordPress
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| function mytheme_html5shiv() { | |
| $result = ""; | |
| $result .= '<!--[if lt IE 9]>'; | |
| $result .= '<script src="'; | |
| $result .= $parent['js']; | |
| $result .= '/html5shiv.js"></script>'; | |
| $result .= '<![endif]-->' . "\n"; | |
| echo $result; | |
| } | |
| add_action('wp_print_scripts', 'mytheme_html5shiv'); | |
| ?> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment