Leave a Reply

4 comments

  1. You will first need to remove the wordpress logo from the login screen. The wordpress logo is added by css, so you will need to change the css and hook that to the login_enqueue_scripts action hook

    function my_login_logo() { ?>
        <style type="text/css">
            body.login div#login h1 a {
                background-image: none;
                background-size: 0 0;
                height: 0;
                margin: 0 auto 0;
                width: 0;
    }
            }
        </style>
    <?php }
    add_action( 'login_enqueue_scripts', 'my_login_logo' );
    

    Next you can add your custom message

    function custom_login_message() {
    $message = "Your custom message goes here";
    return $message;
    }
    add_filter('login_message', 'custom_login_message');
    

    You can go and have a look at the codex for additional hooks and filters for the login form

  2. It really depends on what text you want to replace it with.

    For example: if you want to replace it with the blog title, then believe it or not, it is VERY simple and can be done through CSS alone.

    The blog title already appears in the image, but it’s been shifted offscreen by text-indent and all is required is to return it to normal.

    .login h1 a {
        text-indent: 0;
        background-image: url('');
        background-size: auto;
        width: auto;
        color: #fff;
        font-size: 1.5em;
    }
    

    Setting the URL to '' removes it, in the event you want to totally get rid of the background image. Set colour and size as necessary.

  3. The logo is written into the CSS and the link text and target are filterable:

        105         /**
        106          * Filter link URL of the header logo above login form.
        107          *
        108          * @since 2.1.0
        109          *
        110          * @param string $login_header_url Login header logo URL.
        111          */
        112         $login_header_url = apply_filters( 'login_headerurl', $login_header_url );
        113         /**
        114          * Filter the title attribute of the header logo above login form.
        115          *
        116          * @since 2.1.0
        117          *
        118          * @param string $login_header_title Login header logo title attribute.
        119          */
        120         $login_header_title = apply_filters( 'login_headertitle', $login_header_title );
    
    https://core.trac.wordpress.org/browser/tags/3.8.1/src/wp-login.php#L89
    

    For example:

    function alter_login_headerurl() {
      return 'http://example.com';
    }
    add_action('login_headerurl','alter_login_headerurl');
    
    function alter_login_headertitle() {
      return 'Yay';
    }
    add_action('login_headertitle','alter_login_headertitle');
    

    To alter the image enqueue a login stylesheet and override the background image on .login h1 a.

  4. It’s simple

    function my_custom_logo() {
    echo '<script>jQuery("#header-logo").html("<h1>My Text Logo</h1>")</script>';
    }
    add_action('admin_head', 'my_custom_logo');