Skip to content

Instantly share code, notes, and snippets.

@julian-stark
Created December 17, 2022 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julian-stark/23014f10b4ef81cc54f3b850e207dd50 to your computer and use it in GitHub Desktop.
Save julian-stark/23014f10b4ef81cc54f3b850e207dd50 to your computer and use it in GitHub Desktop.
WordPress Custom Login Screen
/*
* LOGIN SCREEN
*/
// Logo
function sd_custom_login_logo() { ?>
<style type="text/css">
body.login div#login h1 a {
background-image: url(<?php echo get_bloginfo( 'template_directory' ) ?>/img/logo-login.png);
padding-bottom: 10px;
}
</style>
<?php }
add_action( 'login_enqueue_scripts', 'sd_custom_login_logo' );
// Link
function sd_custom_login_logo_url() {
return get_bloginfo( 'url' );
}
add_filter( 'login_headerurl', 'sd_custom_login_logo_url' );
// Title
function sd_custom_login_logo_url_title() {
return get_bloginfo( 'blogname' );
}
add_filter( 'login_headertitle', 'sd_custom_login_logo_url_title' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment