Have you ever noticed alert and error notification messages in the top of your WordPress admin panel? It’s really easy to show your own custom notification message in your WordPress website’s admin panel by adding a little snippet from WordPress’ codex. There are two types of notifications – updated (green) & error (red).
Add following snippet to your current theme’s functions.php file:
function my_admin_notice() { echo ' <div class="updated"> <p>Your custom message!</p> </div>'; } add_action( 'admin_notices', 'my_admin_notice' );
You can replaced updated div class with error class to show a custom error message.
The ending brace of function is forgotten.
Thank you.
Yikes! Thanks for alerting :)
Thank you !