change wp-admin logo in wordpress 4.1

I am using wordpress 4.1 and trying to change the logo in domain.com/wp-admin without any plugin, but did’t find any solution in DOM file I am already using this method, but still not working did i miss something

this code wp-login:

Read More
wp_admin_css( 'login', true );

    /*
     * Remove all stored post data on logging out.
     * This could be added by add_action('login_head'...) like wp_shake_js(),
     * but maybe better if it's not removable by plugins
     */
    if ( 'loggedout' == $wp_error->get_error_code() ) {
        ?>
        <script>if("sessionStorage" in window){try{for(var key in sessionStorage){if(key.indexOf("wp-autosave-")!=-1){sessionStorage.removeItem(key)}}}catch(e){}};</script>
        <?php
    }

    /**
     * Enqueue scripts and styles for the login page.
     *
     * @since 3.1.0
     */
    do_action( 'login_enqueue_scripts' );
    /**
     * Fires in the login page header after scripts are enqueued.
     *
     * @since 2.1.0
     */
    do_action( 'login_head' );

    if ( is_multisite() ) {
        $login_header_url   = network_home_url();
        $login_header_title = get_current_site()->site_name;
    } else {
        $login_header_url   = __( 'http://sumayku-design.web.id/' );
        $login_header_title = __( 'sumayku-design' );
    }

and Style :

.login h1 a {
    background-image: url(http://www.blog.sumayku-design.web.id/wp-content/uploads/2015/01/petra-truss-logo.png);
    -webkit-background-size: 84px;
    background-size: 84px;
    background-position: center top;
    background-repeat: no-repeat;
    color: #999;
    height: 84px;
    font-size: 20px;
    font-weight: normal;
    line-height: 1.3em;
    margin: 0 auto 25px;
    padding: 0;
    text-decoration: none;
    width: 84px;
    text-indent: -9999px;
    outline: none;
    overflow: hidden;
    display: block;
}

Related posts

Leave a Reply

2 comments

  1. That should be right.

    But there are options:

    • the (browser) cache still has the old image.
    • you’re changing the wrong CSS. The css is in /login.min.css , but there is also css/login.css

    But instead of editing the default css, better add a new CSS file (placed after the other one in your page),
    and put something like this in there to overwrite the login image:

      .login h1 a {
        background-image: url(../images/newlogo.jpg);
      } 
    
  2. Usually I use code written below and that works fine when changing admin logo:

    function custom_login_logo() {
    echo '<style type="text/css">
    h1 a { background-image: url(/wp-content/uploads/2014/10/logo.png) !important; 
           background-size: 100% 100% !important;
           background-position: center center !important;
           height: 82px !important;
           width: 359px !important;
           margin-left: -14px !important;
         }
    </style>';
    }
    add_action('login_head', 'custom_login_logo');