Below is the PHP code to add a custom text message to WordPress login page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Add a custom text message to WordPress login page | |
function prefix_login_message($message) { | |
if (empty($message)) { | |
return "<p class=\"login-message\">Add your custom text message here!</p>"; | |
} | |
else { | |
return $message; | |
} | |
} | |
add_filter('login_message', 'prefix_login_message'); | |
//* Load "login-message.css" CSS file stored in active child theme directory | |
function prefix_login_stylesheet() { | |
wp_enqueue_style('custom-login', get_bloginfo('stylesheet_directory') . '/login-message.css'); | |
} | |
add_action('login_enqueue_scripts', 'prefix_login_stylesheet'); |
Below is the CSS code to add a custom text message to WordPress login page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.login-message { | |
color: #777; | |
font-size: 14px; | |
line-height: 1.625; | |
padding: 12px 24px 24px; | |
} |