Created
December 17, 2022 09:46
-
-
Save julian-stark/23014f10b4ef81cc54f3b850e207dd50 to your computer and use it in GitHub Desktop.
WordPress Custom Login Screen
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
/* | |
* 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