diary
diary
wordpressの ログイン画面ロゴの変更
ワードプレスのログイン画面WPロゴを変更したいとき
/* ------------------------------
ログイン画面ロゴの変更
------------------------------ */
function my_custom_login_logo() {
echo '<style type="text/css">
h1 a {
background-image:url('.get_stylesheet_directory_uri() .'/image/wpLogo.png) !important;
background-size: 300px!important;
width: 300px!important;
height: 55px!important;
}
</style>';
}
add_action('login_head', 'my_custom_login_logo');
この部分がポイント
background-image:url('.get_stylesheet_directory_uri() .'/image/wpLogo.png) !important;
子テーマのstyle.cssがあるディレクトリーのimageフォルダーにwpLogo.pngをアップロードしてますよーって感じ。
画像の設置場所や画像名、スタイルなどは任意で編集可能です。