Custom post type has no fields at all

[ad_1]

I have written a function to register my custom post type, and I can see the menu item in the dashboard and can click add new. But when I do the editor page has no fields (because I have set the capability_type to post should I not be able to enter at least the post details? What about title, excerpt, thumbnail? None visible in the editor.

add_action( 'init', 'create_post_type', 0 );

function create_post_type() {

register_post_type( 'codingblog',
// CPT Options
array(
'labels' => array(
'name' => __( 'CodingBlogs' ),
'singular_name' => __( 'CodingBlog' ),
'menu_name' => __( 'My Coding Blog', 'blogus'),
'all_items' => __( 'All Coding Blogs', 'blogus'),
'view_item' => __( 'View Coding Blog', 'blogus'),
'add_new_item' => __( 'Add New Coding Blog', 'blogus'),
'add_new' => __( 'Add New', 'blogus'),
'edit_item' => __( 'Edit Coding Blog', 'blogus'),
'update_item' => __( 'Update Coding Blog', 'blogus'),
'search_items' => __( 'Search Coding Blog', 'blogus'),
'not_found' => __( 'Not Found', 'blogus'),
'not_found_in_trash' => __( 'Not found in Trash', 'blogus'),
),
'label' => __( 'codingblogs', 'blogus' ),
'description' => __( 'Coding Blog Posts', 'blogus'),
'supports' => __( 'title', 'editor', 'excerpt',
'author', 'thumbnail', 'comments',
'revisions', 'custom-fields', ),
'taxonomies' => array( 'post_tag', 'category' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
'rewrite' => array('slug' => 'codingblogs'),
'show_in_rest' => true,
)
);
}

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer