Forked from kontikidigital/custom-login-background.css
Created
October 21, 2019 19:03
-
-
Save tasia53/f8451ee8e575272472b77c9c39b556d1 to your computer and use it in GitHub Desktop.
WordPress: Custom Login
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
| /* TargetIMC Cambiar el fondo */ | |
| body.login { | |
| background-image: url('login-bg.jpg'); | |
| background-repeat: no-repeat; | |
| background-attachment: fixed; | |
| background-position: center; | |
| } |
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
| /* Eliminar el enlace de volver a la Home */ | |
| p#backtoblog { | |
| display: none; | |
| } |
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
| /* TargetIMC Reemplazar Logo */ | |
| .login h1 { | |
| text-align: center; | |
| background-color: rgba(255,255,255,.9); | |
| border-radius: 10px; | |
| -webkit-box-shadow: 10px 10px 10px 0px #636262; | |
| -moz-box-shadow: 10px 10px 10px 0px #636262; | |
| box-shadow: 10px 10px 10px 0px #636262; | |
| } | |
| .login h1 a { | |
| background-image: url('login-logo.png'); | |
| background-size: 250px 76px; /*Modificar aquí para que coincida con el tamaño del logo */ | |
| height: 76px; /*Modificar aquí para que coincida con el tamaño del logo */ | |
| width: 250px; /*Modificar aquí para que coincida con el tamaño del logo */ | |
| } |
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
| /* Eliminar el enlace de password olvidado */ | |
| p#nav { | |
| display: none; | |
| } |
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
| /* TargetIMC Cambiar el fondo */ | |
| body.login { | |
| background-image: url('login-bg.jpg'); | |
| background-repeat: no-repeat; | |
| background-attachment: fixed; | |
| background-position: center; | |
| } | |
| /* TargetIMC Reemplazar Logo */ | |
| .login h1 { | |
| text-align: center; | |
| background-color: rgba(255,255,255,.9); | |
| border-radius: 10px; | |
| } | |
| .login h1 a { | |
| background-image: url('login-logo.png'); | |
| background-size: 250px 76px; /*Modificar aquí para que coincida con el tamaño del logo */ | |
| height: 76px; /*Modificar aquí para que coincida con el tamaño del logo */ | |
| width: 250px; /*Modificar aquí para que coincida con el tamaño del logo */ | |
| } | |
| /*TargetIMC Fomato Caja login BOF*/ | |
| body.login div#login form#loginform { | |
| background: #004170; | |
| -webkit-border-radius: 10px; | |
| -moz-border-radius: 10px; | |
| border-radius: 10px; | |
| -webkit-box-shadow: 10px 10px 10px 0px #636262; | |
| -moz-box-shadow: 10px 10px 10px 0px #636262; | |
| box-shadow: 10px 10px 10px 0px #636262; | |
| } | |
| /*TargetIMC Fomato Caja Registro BOF*/ | |
| body.login div#login form#registerform { | |
| background: #004170; | |
| -webkit-border-radius: 10px; | |
| -moz-border-radius: 10px; | |
| border-radius: 10px; | |
| -webkit-box-shadow: 10px 10px 10px 0px #636262; | |
| -moz-box-shadow: 10px 10px 10px 0px #636262; | |
| box-shadow: 10px 10px 10px 0px #636262; | |
| } | |
| /*TargetIMC Fomato Caja Lost Password BOF*/ | |
| body.login div#login form#lostpasswordform { | |
| background: #004170; | |
| -webkit-border-radius: 10px; | |
| -moz-border-radius: 10px; | |
| border-radius: 10px; | |
| -webkit-box-shadow: 10px 10px 10px 0px #636262; | |
| -moz-box-shadow: 10px 10px 10px 0px #636262; | |
| box-shadow: 10px 10px 10px 0px #636262; | |
| } | |
| /*TargetIMC Fomato texto etiquetas dentro de la caja BOF*/ | |
| .login label { | |
| color: #dddddd; | |
| font-size: 14px; | |
| font-weight: bold; | |
| } | |
| /*TargetIMC Fomato caja input BOF*/ | |
| .login form .input, .login input[type=text], .login form input[type=checkbox] { | |
| background: #dddddd; | |
| -webkit-border-radius: 5px; | |
| -moz-border-radius: 5px; | |
| border-radius: 5px; | |
| -webkit-box-shadow: 2px 2px 2px 0px #636262; | |
| -moz-box-shadow: 2px 2px 2px 0px #636262; | |
| box-shadow: 2px 2px 2px 0px #636262; | |
| } | |
| /*TargetIMC Fomato texto tiquetas fuera de la caja BOF*/ | |
| .login #nav a, .login #backtoblog a { | |
| text-decoration: none; | |
| color: #004170; | |
| font-weight: bold; | |
| } | |
| .login #nav a:hover, .login #backtoblog a:hover { | |
| color: #00416f; | |
| font-weight: bold; | |
| } | |
| /*TargetIMC Formato caja mensajes BOF*/ | |
| div.updated, .login .message, .press-this #message, | |
| div.error, .login #login_error { | |
| background: #0083CD; | |
| color: #ffffff; | |
| font-weight: bold; | |
| -webkit-border-radius: 10px; | |
| -moz-border-radius: 10px; | |
| border-radius: 10px; | |
| -webkit-box-shadow: 10px 10px 10px 0px #636262; | |
| -moz-box-shadow: 10px 10px 10px 0px #636262; | |
| box-shadow: 10px 10px 10px 0px #636262; | |
| border-left: 4px solid #004170; | |
| } | |
| /*TargetIMC Formato texto mensajes*/ | |
| p, .wp_attachment_details label[for=content] { | |
| color: #dddddd; | |
| font-size: 14px; | |
| font-weight: bold; | |
| line-height: 1.5; | |
| margin: 1em 0; | |
| } | |
| /* Eliminar el enlace de password olvidado */ | |
| p#nav { | |
| display: none; | |
| } | |
| /* Eliminar el enlace de volver a la Home */ | |
| p#backtoblog { | |
| display: none; | |
| } |
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
| /* Enque Stylesheet */ | |
| function my_custom_login() { | |
| echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('stylesheet_directory') . '/login/custom-login-styles.css" />'; | |
| } | |
| add_action('login_head', 'my_custom_login'); |
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
| /*Hide the Login Error Message*/ | |
| function login_error_override() | |
| { | |
| return __( 'Incorrect login details.', 'targetimc' ); | |
| } | |
| add_filter('login_errors', 'login_error_override'); | |
| /*Change the Redirect URL */ | |
| function admin_login_redirect( $redirect_to, $request, $user ) { | |
| global $user; | |
| if( isset( $user->roles ) && is_array( $user->roles ) ) { | |
| if( in_array( "administrator", $user->roles ) ) { | |
| return $redirect_to; | |
| } else { | |
| return home_url(); | |
| } | |
| } | |
| else | |
| { | |
| return $redirect_to; | |
| } | |
| } | |
| add_filter("login_redirect", "admin_login_redirect", 10, 3); |
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
| /* Change the Login Logo URL */ | |
| function my_login_logo_url() { | |
| return get_bloginfo( 'url' ); | |
| } | |
| add_filter( 'login_headerurl', 'my_login_logo_url' ); | |
| function my_login_logo_url_title() { | |
| return get_bloginfo( 'name' ) . ' | ' . get_bloginfo( 'description' ); | |
| } | |
| add_filter( 'login_headertitle', 'my_login_logo_url_title' ); |
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
| /*Set “Remember Me” To Checked */ | |
| function login_checked_remember_me() { | |
| add_filter( 'login_footer', 'rememberme_checked' ); | |
| } | |
| add_action( 'init', 'login_checked_remember_me' ); | |
| function rememberme_checked() { | |
| echo "<script>document.getElementById('rememberme').checked = true;</script>"; | |
| } |
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
| /* Custom Login | |
| ------------------------------------------------------------*/ | |
| /* Enque Stylesheet */ | |
| function my_custom_login() { | |
| echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('stylesheet_directory') . '/login/custom-login-styles.css" />'; | |
| } | |
| add_action('login_head', 'my_custom_login'); | |
| /* Change the Login Logo URL */ | |
| function my_login_logo_url() { | |
| return get_bloginfo( 'url' ); | |
| } | |
| add_filter( 'login_headerurl', 'my_login_logo_url' ); | |
| function my_login_logo_url_title() { | |
| return get_bloginfo( 'name' ) . ' | ' . get_bloginfo( 'description' ); | |
| } | |
| add_filter( 'login_headertitle', 'my_login_logo_url_title' ); | |
| /*Hide the Login Error Message*/ | |
| function login_error_override() | |
| { | |
| return __( 'Incorrect login details.', 'targetimc' ); | |
| } | |
| add_filter('login_errors', 'login_error_override'); | |
| /*Change the Redirect URL */ | |
| function admin_login_redirect( $redirect_to, $request, $user ) { | |
| global $user; | |
| if( isset( $user->roles ) && is_array( $user->roles ) ) { | |
| if( in_array( "administrator", $user->roles ) ) { | |
| return $redirect_to; | |
| } else { | |
| return home_url(); | |
| } | |
| } | |
| else | |
| { | |
| return $redirect_to; | |
| } | |
| } | |
| add_filter("login_redirect", "admin_login_redirect", 10, 3); | |
| /*Set “Remember Me” To Checked */ | |
| function login_checked_remember_me() { | |
| add_filter( 'login_footer', 'rememberme_checked' ); | |
| } | |
| add_action( 'init', 'login_checked_remember_me' ); | |
| function rememberme_checked() { | |
| echo "<script>document.getElementById('rememberme').checked = true;</script>"; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment