• Resolved Kyrian

    (@oloccina)


    Hello,
    I want to customize the logo look in the login screen, I tried adding this to my functions.php file

    /*custom css for admin area*/

    add_action(‘admin_head’, ‘my_custom_fonts’);

    function my_custom_fonts() {
    echo ‘<style>
    #adminmenu li.wp-menu-separator {
    border-top: 1px solid #393939;
    }
    #wpadminbar li#wp-admin-bar-wp-logo {
    margin-right: 48px !important;
    width: 150px;
    }
    body.login #login h1 a {
    max-width: 150px !important;
    }
    </style>’;
    }

    it works fine to customize the look of the backend (see css rule for borders in admin menu), but it doesn’t work to customize the login screen with this rule

    body.login #login h1 a {
    max-width: 150px !important;
    }

    am I missing something here?

    thank you

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author GuyPrimavera

    (@guyprimavera)

    Hi Oloccina,

    For the login page, you’ll need to add use another hook: login_enqueue_scripts .

    For example:

      add_action('admin_head', 'my_custom_fonts');
      add_action('login_enqueue_scripts', 'my_custom_fonts');
      
      function my_custom_fonts() {
      echo '<style>
      #adminmenu li.wp-menu-separator {
      border-top: 1px solid #393939; 
      }
      #wpadminbar li#wp-admin-bar-wp-logo {
      margin-right: 48px !important;
      width: 150px;
      }
      body.login #login h1 a {
      max-width: 150px !important; 
      }
      </style>';
      }
    • This reply was modified 5 years, 11 months ago by GuyPrimavera.
    • This reply was modified 5 years, 11 months ago by GuyPrimavera. Reason: code formatting
    Thread Starter Kyrian

    (@oloccina)

    Thank you!
    and for the template too, is really awesome ??

    • This reply was modified 5 years, 11 months ago by Kyrian.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to customize login screen?’ is closed to new replies.