Make WordPress Core

Opened 7 weeks ago

Last modified 7 weeks ago

#65393 new feature request

custom login page

Reported by: avagp Owned by:
Priority: normal Milestone: Awaiting Review
Component: Login and Registration Version:
Severity: normal Keywords:
Cc: Focuses:

Description (last modified by sabernhardt)

i firmly believe in the customize principle of wordpress.

So in every wordpress installation i add this simple PHP code:

if (!class_exists('CustomLoginLogo')) {
    class CustomLoginLogo {
        public function setCustomLogo() {
            $custom_logo_id = get_theme_mod('custom_logo');
            $logo_url = wp_get_attachment_image_url($custom_logo_id, 'full');

            if ($logo_url) {
                echo <<<EOD
<style type="text/css">
    body.login {
        height: auto !important;
		background: #c1c1c1;
    }           
    body.login div#login h1 a {
            background-image: url({$logo_url}) !important;
            background-size: contain !important;
            width: 100% !important;
    }
</style>
EOD;
            }
        }
    }
}
    $customLoginLogo = new CustomLoginLogo();
    add_action('login_head', array($customLoginLogo, 'setCustomLogo'));


This code does 2 things, changes the background color of the login page and replaces the wordpress logo with the site's logo.

With this simple customization, the site feels more yours.

So i am suggesting that this should be in the general settings, pick a color or image as background and change the logo of the login page.

That's my little opinion

Change History (1)

#1 @sabernhardt
7 weeks ago

  • Component GeneralLogin and Registration
  • Description modified (diff)
  • Version 7.0

Related: #35807 (also #33597, #51786, and #60991)

Note: See TracTickets for help on using tickets.