Last active
September 26, 2017 06:24
-
-
Save patric-boehner/96e1bf6ff06b2e59ace132c5e92adbcc to your computer and use it in GitHub Desktop.
Customizing Wordpress 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
| <?php | |
| /** | |
| * Login Page customizations | |
| * | |
| * This file adds the necessary functions and stylesheets to customize the login page. | |
| * | |
| * @package Theme Name | |
| * @author Patrick Boehner <[email protected]> | |
| * @link https:// | |
| * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
| * | |
| */ | |
| //* Block Acess | |
| //********************** | |
| if( !defined( 'ABSPATH' ) ) exit; | |
| //* Login Customizations | |
| //********************** | |
| add_action( 'login_enqueue_scripts', 'pb_custom_login_stylesheet' ); | |
| function pb_custom_login_stylesheet() { | |
| wp_enqueue_style( 'custom-login.min', get_stylesheet_directory_uri() . '/css/style-login.min.css', false, '1.0.1' ); | |
| // wp_enqueue_script( 'custom-login.min', get_stylesheet_directory_uri() . '/js/style-login.min.js', array( 'jquery' ), '1.0.1', true ); | |
| } | |
| add_filter( 'login_headerurl', 'pb_login_logo_url_change' ); | |
| function pb_login_logo_url_change() { | |
| return get_bloginfo( 'url' ); | |
| } | |
| add_filter( 'login_headertitle', 'pb_login_logo_site_title' ); | |
| function pb_login_logo_site_title() { | |
| return get_bloginfo( 'name' ); | |
| } | |
| add_filter( 'login_errors', 'pb_login_errors_message' ); | |
| function pb_login_errors_message() { | |
| $error_message = '<b>Error:</b> Invalid Username/Email or Password'; | |
| return $error_message; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment