custom-login-qrh.php
· 1.6 KiB · PHP
Brut
// custom login styles and logo for QRh
function custom_login_styles() {
$logo_url = 'https://qrh.app/wp-content/uploads/2021/09/QR-h-rojoAsset-7-300x243.png';
?>
<style type="text/css">
/* Change login logo */
body.login div#login h1 a {
background-image: url(<?php echo $logo_url; ?>);
padding-bottom: 30px;
background-size: 300px 243px; /* Adjust to the size of your logo */
width: 300px; /* Width of your logo */
height: 243px; /* Height of your logo */
}
/* Change button background and text color */
body.login #wp-submit, .wp-core-ui .button-primary {
background-color: #21210E !important;
border-color: #21210E !important;
color: #ffffff !important;
box-shadow: none !important;
text-shadow: none !important;
}
/* Hover effect for the button */
body.login #wp-submit:hover, .wp-core-ui .button-primary:hover {
background-color: #18180E !important; /* Slightly darker for hover effect */
border-color: #18180E !important;
}
/* Change link colors */
.login a {
color: #E50913 !important;
}
/* Custom font, title sizes, and line heights */
body.login {
font-family: 'Roboto', sans-serif;
}
.login h1 {
font-size: 24px;
line-height: 32px;
}
.login label {
font-size: 16px;
line-height: 24px;
}
</style>
<?php
}
add_action('login_enqueue_scripts', 'custom_login_styles');
| 1 | // custom login styles and logo for QRh |
| 2 | |
| 3 | function custom_login_styles() { |
| 4 | $logo_url = 'https://qrh.app/wp-content/uploads/2021/09/QR-h-rojoAsset-7-300x243.png'; |
| 5 | ?> |
| 6 | <style type="text/css"> |
| 7 | /* Change login logo */ |
| 8 | body.login div#login h1 a { |
| 9 | background-image: url(<?php echo $logo_url; ?>); |
| 10 | padding-bottom: 30px; |
| 11 | background-size: 300px 243px; /* Adjust to the size of your logo */ |
| 12 | width: 300px; /* Width of your logo */ |
| 13 | height: 243px; /* Height of your logo */ |
| 14 | } |
| 15 | |
| 16 | /* Change button background and text color */ |
| 17 | body.login #wp-submit, .wp-core-ui .button-primary { |
| 18 | background-color: #21210E !important; |
| 19 | border-color: #21210E !important; |
| 20 | color: #ffffff !important; |
| 21 | box-shadow: none !important; |
| 22 | text-shadow: none !important; |
| 23 | } |
| 24 | |
| 25 | /* Hover effect for the button */ |
| 26 | body.login #wp-submit:hover, .wp-core-ui .button-primary:hover { |
| 27 | background-color: #18180E !important; /* Slightly darker for hover effect */ |
| 28 | border-color: #18180E !important; |
| 29 | } |
| 30 | |
| 31 | /* Change link colors */ |
| 32 | .login a { |
| 33 | color: #E50913 !important; |
| 34 | } |
| 35 | |
| 36 | /* Custom font, title sizes, and line heights */ |
| 37 | body.login { |
| 38 | font-family: 'Roboto', sans-serif; |
| 39 | } |
| 40 | |
| 41 | .login h1 { |
| 42 | font-size: 24px; |
| 43 | line-height: 32px; |
| 44 | } |
| 45 | |
| 46 | .login label { |
| 47 | font-size: 16px; |
| 48 | line-height: 24px; |
| 49 | } |
| 50 | </style> |
| 51 | <?php |
| 52 | } |
| 53 | add_action('login_enqueue_scripts', 'custom_login_styles'); |
| 54 |