1

I'd like to add some descriptive text underneath the page title on both the list and edit post screens for the default post and also custom post types - e.g. "Below is a list of your recent blog posts."

What's the best way to do this?

3

If you are OK with using javascript, you can try the following in your functions.php file:

add_action('admin_footer', 'my_admin_footer');
function my_admin_footer()
{
    $uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : NULL ;

    $message = NULL;

    if ($uri AND strpos($uri,'edit.php'))
    {
        if (strpos($uri,'post_type=page'))
        {
            $message = 'My custom message for page list';
        }
        else
        {
            $message = 'My custom message for post list';
        }
    }

    elseif ($uri AND strpos($uri,'post-new.php'))
    {
        if (strpos($uri,'post_type=page'))
        {
            $message = 'My custom message for add/edit page';
        }
        else
        {
            $message = 'My custom message for add/edit post';
        }
    }

    elseif ($uri AND strpos($uri,'post.php'))
    {
        $message = 'My custom message for add/edit post or page';
    }

    if ($message)
    {
        ?><script>
            jQuery(function($)
            {
                $('<div style="margin-bottom:15px; color:#999;"></div>').text('<?php echo $message; ?>').insertAfter('#wpbody-content .wrap h2:eq(0)');
            });
        </script><?php
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.