Skip to content

Instantly share code, notes, and snippets.

@dasbairagya
Last active July 24, 2021 09:43
Show Gist options
  • Save dasbairagya/656c5e3ce4f32f7a7f46cdad04e2495e to your computer and use it in GitHub Desktop.
Save dasbairagya/656c5e3ce4f32f7a7f46cdad04e2495e to your computer and use it in GitHub Desktop.
Change WordPress Login Logo

Change WordPress Login Logo

add_action( 'login_enqueue_scripts', array($this, 'theme_login_logo' ));
	public function theme_login_logo() 
	{ ?>
		<style type="text/css">
			#login h1 a, .login h1 a {
				background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/assets/img/logo/site-login-logo.png);
			height:65px;
			width:320px;
			background-size: 320px 65px;
			background-repeat: no-repeat;
				padding-bottom: 30px;
			}
		</style>
	 <?php 
		add_filter( 'login_headerurl', array($this, 'my_login_logo_url' ));
		add_filter( 'login_headertitle', array($this, 'my_login_logo_url_title' ));

	}
	public function my_login_logo_url() {
		return home_url();
	}
	public function my_login_logo_url_title() {
		return 'Your Site Name and Info';
	}
@dasbairagya
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment