Ticket #30810: twentyfifteen-html5.js.patch
| File twentyfifteen-html5.js.patch, 1.9 KB (added by , 11 years ago) |
|---|
-
trunk/src/wp-content/themes/twentyfifteen/functions.php
231 231 'expand' => '<span class="screen-reader-text">' . __( 'expand child menu', 'twentyfifteen' ) . '</span>', 232 232 'collapse' => '<span class="screen-reader-text">' . __( 'collapse child menu', 'twentyfifteen' ) . '</span>', 233 233 ) ); 234 235 wp_enqueue_script( 'twentyfifteen-html5shiv', get_template_directory_uri() . '/js/html5.js', array(), '3.7.0', false ); 234 236 } 235 237 add_action( 'wp_enqueue_scripts', 'twentyfifteen_scripts' ); 236 238 237 239 /** 240 * Enclose html5shiv in a IE condictional 241 * 242 * @since Twenty Fifteen 1.1 243 */ 244 function twentyfifteen_html5shiv( $tag, $handle, $src ) { 245 if ( 'twentyfifteen-html5shiv' === $handle ) { 246 $tag = "<!--[if lt IE 9]>\n"; 247 $tag .= "<script type='text/javascript' src='$src'></script>\n"; 248 $tag .= "<![endif]-->\n"; 249 } 250 return $tag; 251 } 252 add_filter( 'script_loader_tag', 'twentyfifteen_html5shiv', 10, 3 ); 253 254 /** 238 255 * Add featured image as background image to post navigation elements. 239 256 * 240 257 * @since Twenty Fifteen 1.0 -
trunk/src/wp-content/themes/twentyfifteen/header.php
15 15 <meta name="viewport" content="width=device-width"> 16 16 <link rel="profile" href="http://gmpg.org/xfn/11"> 17 17 <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> 18 <!--[if lt IE 9]>19 <script src="<?php echo esc_url( get_template_directory_uri() ); ?>/js/html5.js"></script>20 <![endif]-->21 18 <script>(function(){document.documentElement.className='js'})();</script> 22 19 <?php wp_head(); ?> 23 20 </head>