Skip to content

Instantly share code, notes, and snippets.

@jpmarchand
Last active November 8, 2015 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpmarchand/9b312c28c991f8a548c9 to your computer and use it in GitHub Desktop.
Save jpmarchand/9b312c28c991f8a548c9 to your computer and use it in GitHub Desktop.
Add a custom text message to WordPress login page. Source: https://codex.wordpress.org/Plugin_API/Filter_Reference/login_message
.login-message {
color: #777;
font-size: 14px;
line-height: 1.625;
padding: 12px 24px 24px;
}
<?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');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment