Custom post types not showing in the admin menu on production, but shows locally

[ad_1]

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’);
“`

[ad_2]

 

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