in WordPress

Show Urgent Messages In WordPress Dashboard

If you use Wordpress dashboard then I'm sure you would of noticed the error messages that are displayed at the top. These will normally be messages from Wordpress to let you know a new version has come out and it's time to upgrade you current version.


These messages can be really be useful to Wordpress developers as you can let your users know about changes you are currently making. Using the below snippet you can add a Message to the dashboard, these can either be error messages or just a notice messages. Add the following to the functions.php file to add the error messages or notice messages.

function showMessage($message, $errormsg = false)
    if ($errormsg) {
        echo '<div id="message" class="error">';
    else {
        echo '<div id="message" class="updated fade">';
    echo "<p><strong>$message</strong></p></div>";

function showAdminMessages()
    showMessage("Welcome to the new Wordpress theme.", true);
add_action('admin_notices', 'showAdminMessages');

Upgrade to access all content on Paulund

Members unlock all tutorials and snippets

Access to all downloadable content

Access to code examples before others

Sign Up Now

Already a member? Login here

Subscribe To The Weekly Newsletter

Get weekly updates to your email