How to change WordPress login page logo with code
To change the WordPress login page icon via code, add the following snippet to your theme’s functions.php file: Upload your…
To change the WordPress login page icon via code, add the following snippet to your theme’s functions.php file:
function custom_login_logo() {
echo '<style>#login h1 a { background-image: url(' . get_stylesheet_directory_uri() . '/images/custom-logo.png); }</style>';}add_action('login_enqueue_scripts', 'custom_login_logo');
Upload your logo to the theme’s /images/ folder, replacing custom-logo.png with your file name. This updates the login page logo without needing a plugin.
How to change WordPress login page logo
Another Example: –
function my_custom_login_logo() {
echo '<style type="text/css">
#login h1 a {
background-image: url(' . esc_url('https://thefallen.in/wp-content/uploads/2024/08/634087ba6698e70e531fbcab_about-me-image-paperfolio-webflow-template.svg') . ') !important;
width: 320px;
height: 80px;
background-size: contain;
background-repeat: no-repeat;
}
</style>';
}
add_action('login_head', 'my_custom_login_logo');
Hi, this is a comment.
To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
Commenter avatars come from Gravatar.