I wanted to replace the wordpress logo which is displayed on login screen with some custom text.
Here is the code what I tried so far:
function my_custom_logo() {
echo '<style type="text/css">
#header-logo { background-image: url('.get_bloginfo('template_directory').'/images/wp-logo.png) !important; }';
}
add_action('admin_head', 'my_custom_logo');
It can replace the logo but what should I need to replace it with some text? Any suggestions to make it work?
You will first need to remove the wordpress logo from the login screen. The wordpress logo is added by css, so you will need to change the css and hook that to the
login_enqueue_scripts
action hookNext you can add your custom message
You can go and have a look at the codex for additional hooks and filters for the login form
It really depends on what text you want to replace it with.
For example: if you want to replace it with the blog title, then believe it or not, it is VERY simple and can be done through CSS alone.
The blog title already appears in the image, but it’s been shifted offscreen by
text-indent
and all is required is to return it to normal.Setting the
URL
to''
removes it, in the event you want to totally get rid of the background image. Set colour and size as necessary.The logo is written into the CSS and the link text and target are filterable:
For example:
To alter the image
enqueue
a login stylesheet and override the background image on.login h1 a
.It’s simple