[wp-trac] [WordPress Trac] #65393: custom login page
WordPress Trac
noreply at wordpress.org
Tue Jun 2 18:23:04 UTC 2026
#65393: custom login page
------------------------------------+------------------------------
Reporter: avagp | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Login and Registration | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
------------------------------------+------------------------------
Changes (by sabernhardt):
* version: 7.0 =>
* component: General => Login and Registration
Old description:
> 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
New description:
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
--
Comment:
Related: #35807 (also #33597, #51786, and #60991)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/65393#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list