1

using this doc from WordPress I was able to remove the default WordPress logo and add my own using

function my_login_logo() { ?>
    <style type="text/css">
        #login h1 a, .login h1 a {
            background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/site-login-logo.png);
        height:65px;
        width:320px;
        background-size: 320px 65px;
        background-repeat: no-repeat;
            padding-bottom: 30px;
        }
    </style>
<?php }
add_action( 'login_enqueue_scripts', 'my_login_logo' );

The link to the WordPress site, not my site, is still there

<h1><a href="http://wordpress.org/" title="Powered by WordPress">Your Site Name</a></h1>

What I am wanting is more like this

<h1><a href="http://example.com/" title="<?PHP get_bloginfo( 'name' ); ?>"><?PHP get_bloginfo( 'name' ); ?></a></h1>
  • It seems you didn't read past the part where you can change the logo because right under it there is an explanation how to change the url function my_login_logo_url() { return home_url(); } add_filter( 'login_headerurl', 'my_login_logo_url' ); – Wilco Jun 4 '18 at 14:48
  • oops my bad I totally skipped right over that part... thanks! – bckelley Jun 4 '18 at 14:50
2

Try the following filters in your functions.php

//wordpress.org > your link
function wp_305258_login_url() {
   return home_url();
}
add_filter( 'login_headerurl', 'wp_305258_login_url' );

//alt text to your site name
function wp_305258_login_title() {
    return get_option( 'blogname' );
}
add_filter( 'login_headertitle', 'wp_305258_login_title' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.