Learn in this tutorial how to insert a custom logo on the WordPress login page using code.
By default, WordPress login page displays its logo just above the “Username” and “Password” fields.
But, what if you prefer to have a custom logo instead of the WordPress logo?
In that case, it’s very easy to change it by code.
This would be the result:
Here’s how to do it:
Snippet to customize the WordPress login page logo
Add the following code at the end of functions.php or in your functionality plugin:
It’s that simple, see?
Now you just have to add the logo in the /images/ folder of the root folder of your Genesis child theme, with the name logo.png.
In case you want to do it through a functionality plugin, replace the line:
$dir = get_stylesheet_directory_uri() . '/images';
With this one:
$dir = plugin_dir_url( __FILE__ ) . 'images';
And put the image into the /images/ folder of your plugin.
If you wish, you can change the path, name and extension of the image in the snippet above, and also resize it as you wish.
With a few lines of code you can customize the logo shown on the WordPress login page.
I’m sure your customers will appreciate this kind of details.
Any questions? I read you in the comments.
And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉