Skip to content

Instantly share code, notes, and snippets.

@shrinkray
Last active December 22, 2019 02:38
Show Gist options
  • Select an option

  • Save shrinkray/a52cbb2253861cb24cbaeb2dac1187c7 to your computer and use it in GitHub Desktop.

Select an option

Save shrinkray/a52cbb2253861cb24cbaeb2dac1187c7 to your computer and use it in GitHub Desktop.
Replace WordPress Login & Logo with other branding for sites.
<?php
/**
* Customized Login Actions
*
*/
function loginlogo() { // TODO use brand colors if possible
echo "<style type=\"text/css\">
.login h1 a {
background-image: url('" . get_template_directory_uri() . "/dist/images/logo-avatar.png') !important;
width:150px;height:150px;background-size:150px 150px;background-position: center center;
}
.login #nav {
text-align: center;
}
#backtoblog {
text-align: center;
color: #008EC2 !important;
}
#backtoblog a {
color: #008EC2 !important;
font-weight: 700;
font-size: 1rem;
}
</style>";
}
add_action('login_head', 'loginlogo');
function greg_loginURL() {
return 'https://gregmiller.io';
}
add_filter('login_headerurl', 'greg_loginURL');
function greg_loginURLtext() {
return 'Greg™ | Mobile-first Branding, Development, Maintenance, & Hosting';
}
add_filter('login_headertitle', 'greg_loginURLtext');
function greg_loginfooter() { ?>
<p style="text-align: center; margin-top: 1em; color: #b4b4b4;">
If you would like a cool site like this, <a style="color: rgba(238,64,11,0.52); text-decoration: none;" href="https://gregmiller.io/contact/">ask for Greg</a>.
</p>
<?php }
add_action('login_footer','greg_loginfooter');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment