I need to add this meta tag to every page in my site.
<meta http-equiv="X-UA-Compatible" content="IE=edge">
I found this PHP function on github
add_action( 'wp_head', 'wsm_keep_ie_modern' );
function wsm_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;
}
I tried adding it to my child theme functions.php file by downloading the file with FTP, adding this chunk to the end in a text editor, and then uploading it (via FileZilla).
This did not work, and viewing the HTML source files in the debugger showed that the meta tag did not appear. I don’t have access to the individual HTML pages otherwise I would just add it manually.
And yes, I know IE sucks times a million, and its older versions are no longer supported, but I’m under strict orders to make it work. Also, I was just thrown into this wordpress mess yesterday having never done web development before (some coding background though). So explain it like I’m five please.
TL;DR: How do I add the same meta tag to every page on my StudioPress website? Also, from my understanding it needs to be in the header and as near the top as possible.