Created
June 30, 2026 22:42
-
-
Save StefsterNYC/211dd685a04101e6ecb504e848568d7a to your computer and use it in GitHub Desktop.
Customize The WordPress Login / Admin Page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function my_login_logo_url() | |
| { | |
| return home_url(); | |
| } | |
| add_filter('login_headerurl', 'my_login_logo_url'); | |
| function my_login_logo() | |
| { ?> | |
| <style type="text/css"> | |
| html { | |
| width: 100%; | |
| min-height: 100%; | |
| background: #000; | |
| overflow-x: hidden; | |
| } | |
| body.login { | |
| background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/login/bg.jpg); | |
| background-size: cover; | |
| background-repeat: no-repeat; | |
| background-position: center center; | |
| background-color: #000; | |
| margin: 0; | |
| padding: 0; | |
| width: 100%; | |
| min-height: 100dvh; | |
| overflow-x: hidden; | |
| } | |
| body.login #login { | |
| width: 100%; | |
| max-width: 36rem; | |
| min-height: 100dvh; | |
| margin: 0; | |
| padding: 3rem 2.5rem; | |
| background:none !important; | |
| box-sizing: border-box; | |
| padding-bottom: calc(2rem + env(safe-area-inset-bottom)); | |
| } | |
| #login h1 { | |
| margin: 0 0 2.25rem; | |
| padding: 0; | |
| text-align: center; | |
| } | |
| #login h1 a, | |
| .login h1 a { | |
| display: block; | |
| width: 100%; | |
| max-width: 25rem; | |
| height: 7.25rem; | |
| margin: 0 auto; | |
| background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/login/logo.png); | |
| background-size: contain; | |
| background-repeat: no-repeat; | |
| background-position: center; | |
| box-shadow: none !important; | |
| -webkit-box-shadow: none !important; | |
| -moz-box-shadow: none !important; | |
| outline: none !important; | |
| } | |
| body.login .user-pass-wrap{ | |
| margin-top:1rem !important; | |
| } | |
| body.login .message { | |
| width: 100%; | |
| max-width: 26rem; | |
| margin:1rem auto 1rem !important; | |
| padding:2.5rem !important; | |
| border: 1px solid #00bff3 !important; | |
| box-shadow: 0 8px 32px rgba(0,0,0,0.25) !important; | |
| background: rgba(0,0,0,0.15) !important; | |
| backdrop-filter: blur(6px); | |
| -webkit-backdrop-filter: blur(6px); | |
| border-radius: 10px !important; | |
| box-sizing: border-box; | |
| } | |
| body.login form, | |
| body.login #loginform, | |
| body.login #lostpasswordform, | |
| body.login #registerform, | |
| body.login .admin-email-confirm-form { | |
| width: 100%; | |
| max-width: 26rem; | |
| margin: 0 auto; | |
| padding: 2.5rem; | |
| border: 1px solid #00bff375 !important; | |
| box-shadow: 0 8px 32px rgba(0,0,0,0.25) !important; | |
| background: rgba(0,0,0,0.15) !important; | |
| backdrop-filter: blur(6px); | |
| -webkit-backdrop-filter: blur(6px); | |
| border-radius: 10px !important; | |
| box-sizing: border-box; | |
| } | |
| input, | |
| textarea, | |
| select, | |
| button, | |
| a, | |
| a:focus, | |
| input:focus, | |
| textarea:focus, | |
| select:focus, | |
| button:focus { | |
| outline: none !important; | |
| box-shadow: none !important; | |
| } | |
| body.login #lostpasswordform input{ | |
| margin-bottom: 1em; | |
| } | |
| body.login input[type="text"], | |
| body.login input[type="password"], | |
| body.login input[type="email"]{ | |
| border:none !important; | |
| outline: none !important; | |
| box-shadow: none !important; | |
| } | |
| body.login form p { | |
| margin-bottom: 1.1rem; | |
| } | |
| body.login a{ | |
| color:#00aeff !important; | |
| } | |
| body.login label, | |
| body.login .user-pass-wrap, | |
| body.login #nav a, | |
| body.login #backtoblog, | |
| body.login #backtoblog a, | |
| body.login .message, | |
| body.login #loginform, | |
| body.login #login_error, | |
| body.login #registerform p, | |
| body.login #registerform label, | |
| body.login .admin-email-confirm-form p, | |
| body.login .admin-email-confirm-form h1 { | |
| color: #fff !important; | |
| } | |
| body.login .notice-error { | |
| width: 100%; | |
| max-width: 26rem; | |
| margin: 1rem auto !important; | |
| padding: 2.5rem; | |
| border: 1px solid #d60f0f82 !important; | |
| box-shadow: 0 8px 32px rgba(0,0,0,0.25) !important; | |
| background: rgb(244 67 54 / 42%) !important; | |
| backdrop-filter: blur(6px); | |
| -webkit-backdrop-filter: blur(6px); | |
| border-radius: 10px !important; | |
| box-sizing: border-box; | |
| } | |
| body.login #lostpasswordform label { | |
| display: block !important; | |
| text-align: center !important; | |
| color: #fff !important; | |
| } | |
| body.login input[type="text"], | |
| body.login input[type="password"], | |
| body.login input[type="email"] { | |
| display: block; | |
| width: 100% !important; | |
| max-width: 24rem; | |
| margin: 0 auto; | |
| box-sizing: border-box; | |
| border-radius: 0 !important; | |
| font-size: 16px !important; | |
| } | |
| body.login p.forgetmenot { | |
| margin-bottom: 1rem !important; | |
| text-align: left; | |
| } | |
| body.login p.forgetmenot label { | |
| display: inline-flex; | |
| align-items: center; | |
| margin:1rem 0; | |
| gap: 0.35rem; | |
| } | |
| body.login #rememberme { | |
| appearance: none !important; | |
| -webkit-appearance: none !important; | |
| width: 18px !important; | |
| height: 18px !important; | |
| min-width: 18px !important; | |
| border: 2px solid #4CAF50 !important; | |
| border-radius: 50% !important; | |
| background: #fff !important; | |
| box-shadow: none !important; | |
| cursor: pointer; | |
| position: relative; | |
| margin: 0 0.35rem 0 0 !important; | |
| } | |
| body.login #rememberme::before { | |
| content: none !important; | |
| display: none !important; | |
| } | |
| body.login #rememberme:checked { | |
| background: #4CAF50 !important; | |
| border-color: #fff !important; | |
| } | |
| body.login #rememberme:checked::after { | |
| content: ''; | |
| position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| width:9px; | |
| height:9px; | |
| background: #fff !important; | |
| border-radius: 50%; | |
| transform: translate(-50%, -50%); | |
| } | |
| body.login #nav, | |
| body.login #backtoblog, | |
| body.login #lostpasswordform p, | |
| body.login #registerform p, | |
| body.login .admin-email-confirm-form p, | |
| body.login .admin-email-confirm-form h1 { | |
| text-align: center; | |
| } | |
| body.login #backtoblog, | |
| body.login #backtoblog a { | |
| padding: 1em !important; | |
| } | |
| body.login .submit input[type="submit"], | |
| body.login input#wp-submit { | |
| display: block; | |
| width: 100% !important; | |
| max-width: 24rem; | |
| margin: 0 auto; | |
| padding: 1rem; | |
| line-height: 1.2; | |
| background: #00bff3 !important; | |
| border: none !important; | |
| border-radius: 0 !important; | |
| color: #fff !important; | |
| text-shadow: none !important; | |
| box-shadow: none !important; | |
| -webkit-box-shadow: none !important; | |
| -moz-box-shadow: none !important; | |
| box-sizing: border-box; | |
| font-size: 16px !important; | |
| } | |
| @media (max-width: 64em) { | |
| body.login #login { | |
| max-width: 32rem; | |
| padding: 2.5rem 2rem; | |
| padding-bottom: calc(2rem + env(safe-area-inset-bottom)); | |
| } | |
| body.login form, | |
| body.login #loginform, | |
| body.login #lostpasswordform, | |
| body.login #registerform, | |
| body.login .admin-email-confirm-form, | |
| body.login input[type="text"], | |
| body.login input[type="password"], | |
| body.login input[type="email"], | |
| body.login .submit input[type="submit"], | |
| body.login input#wp-submit { | |
| max-width: 22rem; | |
| } | |
| } | |
| @media (max-width: 48em) { | |
| body.login #login { | |
| max-width: 100%; | |
| min-height: 100dvh; | |
| padding: 1.75rem 1.25rem 2rem; | |
| padding-bottom: calc(2rem + env(safe-area-inset-bottom)); | |
| } | |
| #login h1 { | |
| margin-bottom: 1.5rem; | |
| } | |
| #login h1 a, | |
| .login h1 a { | |
| max-width:25rem; | |
| height: 7.75rem; | |
| } | |
| body.login form, | |
| body.login #loginform, | |
| body.login #lostpasswordform, | |
| body.login #registerform, | |
| body.login .admin-email-confirm-form, | |
| body.login input[type="text"], | |
| body.login input[type="password"], | |
| body.login input[type="email"], | |
| body.login .submit input[type="submit"], | |
| body.login input#wp-submit { | |
| max-width: 23rem; | |
| } | |
| body.login form p { | |
| margin-bottom: 1rem; | |
| } | |
| body.login p.forgetmenot { | |
| max-width:23rem; | |
| margin-left: auto !important; | |
| margin-right: auto !important; | |
| } | |
| } | |
| </style> | |
| <?php } | |
| add_action('login_enqueue_scripts', 'my_login_logo'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment