Custom WordPress branded login and custom redirects
Do you need a custom WordPress branded login and custom redirects in the dashboard? This snippet will customise the standard WordPress login page, you will need to create a logo and change some of the url parameters to suit your needs. This would be an ideal snippet for a plugin.
// This snippet redirects the login logo upon click add_filter( 'login_headerurl', 'my_custom_login_url' ); function my_custom_login_url($url) { return 'http://www.squareonemd.co.uk'; } //This snippet allows you to change the logo you see when you login to WordPress(http://website.com/wp-admin). Just put the snippet in functions.php, and then add your login image to a folder called images in your theme folder. function custom_login_logo() { echo '<style type="text/css"> h1 a { background-image:url(http://www.squareonemd.co.uk/wproute/login-logo.png) !important; } </style>'; } add_action('login_head', 'custom_login_logo'); //Change the alt text for login image function change_wp_login_title() { echo 'Square One Web and Design'; }add_filter('login_headertitle', 'change_wp_login_title'); //Change the footer link in the admin area function remove_footer_admin () { echo 'Web site design and development by <a href="http://www.squareonemd.co.uk">Square One</a>.'; } add_filter('admin_footer_text', 'remove_footer_admin'); //Change the header logo in the admin area function custom_admin_logo() { echo '<style type="text/css"> #header-logo { width:32px; height:32px; background-image: url(http://www.squareonemd.co.uk/wproute/admin-logo.png) !important; } </style>'; } add_action('admin_head', 'custom_admin_logo');
Thank you Elliott for all the excellent WordPress tips. A question for you on branding the login: how would you change the form field labels? For example, at many higher education schools using LDAP, the “username” label is not a word associated with login. Rather higher ed schools usually have their own branded term for a username.
Hi Deborah, glad you are liking the snippets. Personally I would say ‘username’ is the most common form of labelling a login form however I think this has been answered on StackExchange function to change a label username
I haven’t tested it personally.
Aha, thank you Elliott. I had not seen that StackExchange answer.
Yes, username is the most common label for a login form. Except at higher ed schools where someone decides to create “unique names” associated with the school.