Are you looking for a way to change the default login logo? This snippet allows you to change the logo you see when you login to WordPress.
Instructions:
- Add this code to your theme’s functions.php file or in a site-specific plugin.
function custom_login_logo() { echo '<style type="text/css"> h1 a { background-image:url('.get_bloginfo('template_directory').'/images/login_logo.png) !important; } </style>'; } add_action('login_head', 'custom_login_logo');
- Name your login image
login_logo.png
. - Then add your login image to a folder called
images
in your theme folder.
Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly copy / paste code snippets in WordPress, so you don’t accidentally break your site.
If you liked this code snippet, please consider checking out our other articles on the site like: 6 Best WordPress Security Plugins Compared.
Thanks.