Tektriks

Coding starts here
Home / Blog

Customize or Branding WordPress Login Page

Sometimes when you are developing a site using WordPress, you have to white labeling or branding your admin section as per client requirement. Here comes the first page is login page. When you visit a default login page in WordPress, you might come across this view:

Now, you can change the theme of your login page as brand new one.

By using some codes in functions.php file, you may customize the look and feel of your login page.

Replace WordPress logo with site / theme logo

<?php
function your_theme_login_logo() { ?>
	<style type="text/css">
		body{background:#ededed !important}
		#backtoblog{display:none}
		#login h1 a, .login h1 a {
			background-image: url("<?php echo get_stylesheet_directory_uri(); ?>/images/logo-2.png");
			background-size: 200px auto;
			max-width: 100%;
			padding-bottom: 10px;
			width: auto;
		}
	</style>
<?php }
add_action( 'login_enqueue_scripts', 'your_theme_login_logo' );
?>

Change link https://wordpress.org/ to site url in login page logo

<?php
function your_theme_logo_url() {
  return home_url('/');
}
add_filter( 'login_headerurl', 'your_theme_logo_url' );
?>

Change title “Powered by WordPress” to site name in login page logo

<?php
function your_theme_logo_url_title() {
  return 'Tektriks';
}
add_filter( 'login_headertitle', 'your_theme_logo_url_title' );
?>
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x