0

I have a custom post type called "Films" that is used to manage an entire film collection. I would like to create a custom box with a message that will sit on top of all of the posts when you click on the Films button in the wordpress admin area. Currently (and by default) there is no messaging, just an index of all the posts in this post type. I want a box to appear above all of the posts with my message.

The purpose of the box is to give admins of the site some direction on how to populate the films section. Any idea how I could go about this in wordpress? It is important to note that this message box should ONLY appear on the films custom post type, not on the dashboard or anywhere else.

2
add_action('admin_notices', 'my_custom_notice');
function my_custom_notice()
{
    global $current_screen;

    if ( 'my_post_type' == $current_screen->post_type )
        {
            echo "<h1>Whatever needs to be said</h1>";
        }
}

Put this in your functions.php or plugin file. Replace 'my_post_type' with the name of your post type.

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.