Wordpressのテンプレごにょって某ホスティングの自動挿入抑制(崩れるのを防ぐ苦肉の策)してるけどテンプレ(っていうか今回はプラグイン)更新したらまた消えちゃったのでメモ。
よく考えたらプラグイン作ってやって全テンプレで効くようにしておいたほうがよかったけど今回はめんどくさかったのでパス。
で、方法は簡単。function.php
とかにadd_action
を書いてやるだけ。
function.php
add_action( 'send_headers', 'add_header_xua' );
function add_header_xua() {
header( 'X-UA-Compatible: IE=edge,chrome=1' );
}
参考
https://codex.wordpress.org/Plugin_API/Action_Reference/send_headers
http://wiki.grepgrape.net/index.php?WordPress/HTTP%E3%83%98%E3%83%83%E3%83%80%E3%83%BC%E3%81%AE%E9%80%81%E4%BF%A1