-
-
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
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; | |
} |
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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment