Looking to change the logo on the WordPress admin login page? All you may need to do is add some functions to restyle your WordPress login page.
2 answers
1
Changing the logo of your WordPress admin login
Adding Your Logo
To add your logo, you need to tell WordPress where your logo file is located. You can do this by following the steps below.
- Make sure that your theme has theme support for using a custom logo;
- Navigate to Appearance > Customise from your WordPress Dashboard;
- Set your logo by clicking Site Identity.
Adding The Style
You need to access your WordPress theme’s functions.php file to restyle the admin login page. You can do this by following the steps below.
- Navigate to Appearance > Editor > Theme Functions from your WordPress Dashboard;
- Add in the code below and edit the hex colour codes to match your theme;
- Click Update File to save the changes.
function custom_login_logo() { echo '<style type="text/css"> body {background-color: #000000 !important;} a {color: #FFFFFF !important;} h1 a { background-image:url("' . wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' )[0] . '") !important; -webkit-background-size: contain !important; background-size: contain !important; background-position: bottom !important; height: 150px !important; width: 100% !important; outline: none !important;} h1 a:focus { -webkit-box-shadow: none !important; box-shadow: none !important;} </style>'; } add_action( 'login_head', 'custom_login_logo' );
— Support WizardAnswer 1
0
Changing the logo URL of your WordPress admin login
You may also want to change the default URL on the logo from the WordPress website to your own. You can do this by following the steps below.
- Navigate to Appearance > Editor > Theme Functions in your WordPress Dashboard;
- Add in the code below;
- Click Update File to save the changes.
function custom_loginlogo_url( $url ) { return get_bloginfo( 'url' ); } add_filter( 'login_headerurl', 'custom_loginlogo_url' );
— Support WizardAnswer 2