Skip to content

Instantly share code, notes, and snippets.

@nickcernis
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickcernis/c3fec859923d2e494ad6 to your computer and use it in GitHub Desktop.
Save nickcernis/c3fec859923d2e494ad6 to your computer and use it in GitHub Desktop.
Ask IE not to use compatibility view (Note: may not work with caching plugins; use Apache/nginx to send headers instead)
<?php
// Don't copy the opening <?php tag above!
// Send headers to ask IE NOT to use compatibility mode
add_filter( 'wp_headers', 'genesis_keep_ie_modern' );
function genesis_keep_ie_modern( $headers ) {
if ( isset($_SERVER['HTTP_USER_AGENT']) && (strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false) ) {
$headers['X-UA-Compatible'] = 'IE=edge';
}
return $headers;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment