工作好きな情報系の雑記

[WordPress] 管理画面含めてfaviconをダークテーマに対応させる

公開されるページのfaviconをダークテーマに対応させるだけであれば、header.phpの<head>タグ内にダークテーマに対応したfavicon.svgを記載すればよい。(方法はググったら出てくると思う)

管理画面のfavicon含めてダークテーマに対応させるのであれば、functions.phpに下記を記載すればよい。
管理画面の<head>タグはcoreファイル(admin-header.php)で生成されるので、直接いじるのはメンテナンス観点で良くない。

How can I add favicon to my WordPress site in both front end, and admin panel. I've tried many ways, but failed.I know, to show favicon the code is:<link rel="shortcut icon" href="images/fav...
How to add favicon to my site - in both front end and admin panel - WordPress Development Stack Exchange

上記を設定したら、[外観] -> [カスタマイズ] -> [サイト基本情報] -> [サイトアイコン] は削除しておいた方がよさそう。

どのfaviconを記載するかは下記サイトを参考にした。
ブラウザによってsvgが使える・使えないが変わるのはやめてほしいね。
早くsvg一個書けば全ブラウザで動作するようになってほしい...

The ultimate favicon generator. Design your icons platform per platform and make them look great everywhere. Including in Google results pages.
Favicon Generator for perfect icons on all browsers - RealFaviconGenerator.net
モバイルバージョンを終了