Skip to content

Instantly share code, notes, and snippets.

@jpmarchand jpmarchand/login-message.css Secret
Last active Nov 8, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.