Community Forums › Forums › Archived Forums › Design Tips and Tricks › Customize Login Logo Without A Plugin
- This topic has 9 replies, 6 voices, and was last updated 7 years, 2 months ago by
denverserrao.
-
AuthorPosts
-
November 14, 2012 at 9:51 pm #171
Jon Weiss
MemberAdd these lines of code in your functions.php:
// Custom WordPress Login Logo
function login_css() {
wp_enqueue_style( 'login_css', get_stylesheet_directory_uri(). '/css/login.css' );
}
add_action('login_head', 'login_css');
As you can see, I've chosen to create a new stylesheet file for the login form. Although I prefer to do it this way, you can use the stylesheet of your current theme and just skip the step above.
Next, add the following to the stylesheet:
#login h1 a {
background-image: url("http://YOUR-WEBSITE.com/wp-content/themes/YOUR_THEME/images/custom_logo.png") !important;
}
November 15, 2012 at 2:09 pm #213Lindsey Riel
MemberThis is awesome, thank you for sharing 🙂
Lindsey
prettydarncute.comNovember 15, 2012 at 3:48 pm #225Jon Weiss
MemberGlad you like it... Happy to help! 🙂
November 15, 2012 at 7:29 pm #245SMB-dev
MemberVery nice stuff indeed. Will be updating my code snippets list - Thanks Again and keep em coming 🙂
“Life is Social” & “Social is the Lifeblood” of a Small Business Owner.
November 15, 2012 at 7:37 pm #246Lindsey Riel
MemberI tried adding this code this evening and was unable to get it to work.
Lindsey
prettydarncute.comNovember 15, 2012 at 9:13 pm #254Jon Weiss
MemberThat's weird. Did you add the style to your current stylesheet or to a new one? What's the link where I can see your attempt?
November 15, 2012 at 10:28 pm #262wpsmith
MemberHello,
You need to change get_template_directory_uri() to CHILD_URL or get_stylesheet_directory_uri()
November 15, 2012 at 10:31 pm #265Seth
MemberHere's the code that I normally use to customize the login logo and it works pretty well.
/******* Customize Login Logo ******/
function my_custom_login_logo() {
echo '
h1 a { background-image:url('.get_bloginfo( 'stylesheet_directory' ).'/images/login-logo.png) !important; }
';
}add_action( 'login_head', 'my_custom_login_logo' );
function my_custom_login_url() {
return site_url();
}
add_filter( 'login_headerurl', 'my_custom_login_url', 10, 4 );
November 16, 2012 at 7:22 am #282Jon Weiss
MemberThanks for pitching in :). I pulled this one from my "archives" so I guess it's a bit dated.I tweaked the code so it should work better now.
There's definitely a handful of ways to accomplish this, so keep in mind this is just one of many ways.
November 19, 2018 at 9:01 am #224454denverserrao
Participant// Adds support for editor color palette.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.