Skip to content

Instantly share code, notes, and snippets.

@strsar
Created October 7, 2021 01:41
Show Gist options
  • Save strsar/ab8b107adb15a326e5b0d6a47d35008f to your computer and use it in GitHub Desktop.
Save strsar/ab8b107adb15a326e5b0d6a47d35008f to your computer and use it in GitHub Desktop.
[WP] Brand login
<?php defined('ABSPATH') or header('Location: /');
/**
* Admin login form
*/
add_action('login_enqueue_scripts', function() {
$upload_dir = wp_upload_dir();
echo '<style>#login h1 a, .login h1 a {background-image:url('.$upload_dir['baseurl'].'/site/login.svg);background-size:72px}</style>';
});
add_filter('login_headertext', function() {
return get_bloginfo('name');
});
add_filter('login_headerurl', function() {
return home_url();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment