Create field of Custom Post Types

I am using below code to create Custom Post Types.

$supports = array(
                    'title', // post title
                    'editor', // post content
                    'author', // post author
                    'thumbnail', // featured images
                    'excerpt', // post excerpt
                    'custom-fields', // custom fields
                    'comments', // post comments
                    'revisions', // post revisions
                    'post-formats', // post formats
                );

                $labels = array(
                    'name' = _x('news', 'plural'),
                    'singular_name' = _x('news', 'singular'),
                    'menu_name' = _x('news', 'admin menu'),
                    'name_admin_bar' = _x('news', 'admin bar'),
                    'add_new' = _x('Add New', 'add new'),
                    'add_new_item' = __('Add New news'),
                    'new_item' = __('New news'),
                    'edit_item' = __('Edit news'),
                    'view_item' = __('View news'),
                    'all_items' = __('All news'),
                    'search_items' = __('Search news'),
                    'not_found' = __('No news found.'),
                );

                $args = array(
                    'supports' = $supports,
                    'labels' = $labels,
                    'public' = true,
                    'query_var' = true,
                    'rewrite' = array('slug' = 'news'),
                    'has_archive' = true,
                    'hierarchical' = false,
                );
                register_post_type('news', $args);

I am getting below Form at the time of Custom Post entry.

How can I add another Text field after Title named Name ?

Topic wp-admin custom-post-types Wordpress

Category Web


As you are using the classic editor, you can add new input fields to the editing view by creating custom metaboxes. This is done with add_meta_box(). Check out the code reference for further details and good examples on how to register a metabox, and how to save and edit post meta with it.

Although I can't quite remember, if it is possible to have the metabox between the title and editor fields.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.