Personnaliser le logo de connexion WordPress sans plugin

  1. Connect to your WordPress site via FTP.

  2. Navigate to the root directory of your WordPress installation.

  3. Locate the "wp-content" folder.

  4. Within "wp-content," find the "themes" folder and then select your active theme.

  5. Inside your active theme folder, create a new folder named "custom-login."

  6. In the "custom-login" folder, upload your custom login logo image. Name it "login-logo.png" and ensure its dimensions are appropriate.

  7. Create a new file in the "custom-login" folder named "style.css."

  8. Edit the "style.css" file and add the following CSS code:

body.login div#login h1 a {
    background-image: url('login-logo.png');
    background-size: contain;
    width: [your-logo-width]px; / replace with your logo width /
    height: [your-logo-height]px; / replace with your logo height /
}

Replace "[your-logo-width]" and "[your-logo-height]" with the dimensions of your logo.

  1. Save the changes to the "style.css" file.

  2. Now, go back to your active theme folder and find the "functions.php" file.

  3. Edit the "functions.php" file and add the following code at the end:

function custom_login_logo_url() {
    return home_url();
}
add_filter( 'login_headerurl', 'custom_login_logo_url' );

function custom_login_logo_url_title() {
    return 'Your Site Title Here'; / replace with your site title /
}
add_filter( 'login_headertitle', 'custom_login_logo_url_title' );

Replace 'Your Site Title Here' with your actual site title.

  1. Save the changes to the "functions.php" file.

  2. Clear your browser cache and visit the WordPress login page to see your custom login logo.