• I came across a code to add a image to the wordpress login by dropping a snippet of code in the functions.php file and adding the url of the image. The code must be wrong because i can’t get to the functions file anymore all it goes to is banner.css, and the site is messed up. Can anyone help me get back to the functions file so i can take out the bad code? thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Look for such code:

    function my_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', 'my_custom_login_logo');

    That’s the correct code to change the login page logo.

    Thread Starter jsilvestrone

    (@jsilvestrone)

    i used this code, but replaced the part “background image:url” with the url of hosted image.

    unfortunately, when i click on the “editor” tab the only file that shows is banner.css — it’s not coming up with the usual screen that has all of the files, including functions.php

    Do you know what the shortcut url to the file you need to put that code you shared above in? thanks

    I am not sure I fully understand what you meant to do: the important part, the one you can modify is:
    '.get_bloginfo('template_directory').'/images/login-logo.png
    This links to the /images/ folder inside your theme folder. You can simply move your logo there, and name it login-logo.png, or change only that part of the code to the one you need.

    If you want to link to an external image, you need to provide the full url (with https://&#8230;) and thus replace all the template directory call

    Does that work for you?

    definitely works…I just threw it up in my theme! cool…I was using a plugin to do this, I like just dropping it into functions way better

    Thread Starter jsilvestrone

    (@jsilvestrone)

    i appreciate all of your guys help, but the main issue i am facing is that i can’t get to the functions file anymore or any other file besides banner.css, since i updated it with bad code ?? need to figure out how to get back to functions through a shortcut and take out the bad code, update it, and hopefully everything will be back to normal. Do you understand the problem? thanks

    monza

    (@monza)

    For any file within WordPress, you can access the wordpress directory on your FTP site. Download the file, modify it, and upload.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘wordpress login screen image change issue’ is closed to new replies.