Child theme custom login styling
-
Topic
-
Jason,
In your developer docs, you mention that “unfortunately our custom stylesheet gets applied everywhere except for the WordPress login page.”
You ended up using a function with the styles.I just wanted to point out a different way I accomplished this.
Not just pertinent to JumpStart, but any theme.
I created a custom function that calls up my custom login stylesheet in my child theme assets/css directory like so:/*--------------------------------------------------------*/ /* Custom Login Stylesheet Override /*--------------------------------------------------------*/ function wpck_custom_login() { $wpckstylesheet = get_stylesheet_directory_uri() . '/assets/css/wpck-custom-login.css'; echo '<!-- custom login css --> <link rel="stylesheet" type="text/css" href="' . $wpckstylesheet . '" /> <!-- /end custom login css -->'; } function wpck_wp_login_url() { return get_home_url(); } function wpck_wp_login_title() { return get_option('blogname'); } add_filter('login_headerurl', 'wpck_wp_login_url'); add_filter('login_headertitle', 'wpck_wp_login_title'); add_action('login_head', 'wpck_custom_login');
Here’s the example: PCB custom login
(Note: the site link isn’t JS at the moment, just a placeholder theme. The JS version is being developed local, but it doesn’t matter, the login function is the same)
I also have a completely different method that incorporates the login, lost password, and registration right into the site design/pages. I am re-factoring that, but wanted to mention it.
- You must be logged in to reply to this topic.