Custom WordPress Login Page Logo and URL

Published

December 5, 2014

Category

Development

Branding is everything! When you develop a theme it is a pretty nice option to customise the standard login page of WordPress with your own logo and add a custom url to it. The function below changes the standard login page image, the url and the hover text of the image/logo. You can find the full documentation in the Wordpress Codex here.

PHP

Add the following code to the functions.php of your theme and change the URLs/Strings as described inside the snippet:

<?php 
// changing the login page image/logo
	function custom_image() {
		echo "
		<style>
		body.login #login h1 a {
			background: url('".get_bloginfo('template_url')."URL-path') no-repeat scroll center top transparent; //Past your image (located in your theme folder) path instead of "URL-path" (example: /images/logo.png)
			height: 82px;
			width: 326px;
			padding-bottom: 20px;
		}
		</style>
		";
	}
	add_action("login_head", "custom_image");
	
// changing the login page URL
    function custom_url(){
    return ('https://www.internetkultur.at/'); // Custom URL to redirect to (Standard value: wordpress.com)
    }
    add_filter('login_headerurl', 'custom_url');
    
// changing the login page URL hover text
    function custom_title(){
    return ('Development by INTERNETKULTUR powered by WordPress'); // changing the title from "Powered by WordPress" to your custom one
    }
    add_filter('login_headertitle', 'custom_title');
?>

Example

internetkultur-custom-wordpress-login

INTERNETKULTUR | © 2018 | Imprint