The problem I’m facing is:
**Locally**:
_It shows all three custom post types in the admin menu_
**Production**:
_It shows only the first two custom post types in the admin menu_
Has anyone else encountered this problem? Can someone point to me where I’m going wrong? Thanks.
“`
<?php
function theme_post_types() {
// Event post type
register_post_type(‘event’, array(
‘show_in_rest’ => true,
‘supports’ => array(‘title’, ‘editor’, ‘excerpt’),
‘rewrite’ => array(‘slug’ => ‘events’),
‘has_archive’ => true,
‘public’ => true, // makes it visible to users
‘labels’ => array(
‘name’ => ‘Events’, // label in the dashboard
‘add_new_item’ => ‘Add New Event’,
‘edit_item’ => ‘Edit Event’,
‘all_items’ => ‘All Events’,
‘singular_name’ => ‘Event’
),
‘menu_icon’ => ‘dashicons-calendar’
));
// Professor post type
register_post_type(‘professor’, array(
‘show_in_rest’ => true,
‘supports’ => array(‘title’, ‘editor’, ‘thumbnail’),
// ‘rewrite’ => array(‘slug’ => ‘professors’),
// ‘has_archive’ => true,
‘public’ => true, // makes it visible to users
‘labels’ => array(
‘name’ => ‘Professors’, // label in the dashboard
‘add_new_item’ => ‘Add New Professor’,
‘edit_item’ => ‘Edit Professor’,
‘all_items’ => ‘All Professors’,
‘singular_name’ => ‘Professor’
),
‘menu_icon’ => ‘dashicons-businessperson’
));
// videos post type
register_post_type(‘video’, array(
‘show_in_rest’ => true,
‘supports’ => array(‘title’, ‘editor’, ‘thumbnail’),
// ‘rewrite’ => array(‘slug’ => ‘videos’),
// ‘has_archive’ => true,
‘public’ => true, // makes it visible to users
‘labels’ => array(
‘name’ => ‘Videos’, // label in the dashboard
‘add_new_item’ => ‘Add New Video’,
‘edit_item’ => ‘Edit Video’,
‘all_items’ => ‘All Videos’,
‘singular_name’ => ‘Video’
),
‘menu_icon’ => ‘dashicons-video-alt3’
));
}
add_action(‘init’, ‘theme_post_types’);
“`
