Skip to content

Instantly share code, notes, and snippets.

@mattmckenny
Created September 10, 2014 14:05
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 mattmckenny/f516ed2a07b55bbde414 to your computer and use it in GitHub Desktop.
Save mattmckenny/f516ed2a07b55bbde414 to your computer and use it in GitHub Desktop.
IE force edge in WordPress
<?php
// Forces edge in IE browsers
add_filter('wp_headers', 'bf_ie_add_header');
function bf_ie_add_header($headers) {
if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) {
$headers['X-UA-Compatible'] = 'IE=edge,chrome=1';
}
return $headers;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment