Add Image To Custom Post Type (Pages)

under mu-plugins register this:


//Create New Post Type Here
function custom_post_types(){
    //Register Professors Post Type
    register_post_type('professor', array(  
        'show_in_rest' => true,
        //Add title, new editor, FEATURED image thumbnail
        'supports' => array('title', 'editor', 'thumbnail'), 
        'public' => true,
        'labels' => array(
            'name' => 'Professors',
            'add_new' => 'Add New Professor',            
            'add_new_item' => 'Add New Professors',
            'edit_item' => 'Edit Professor',
            'all_items' => 'All Professors',
            'singular_name' => 'Professor'
        ),
        'menu_icon' => 'dashicons-welcome-learn-more'
    ));
}
add_action('init', 'custom_post_types');
Scroll to Top