Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

CMS test

testing CPT

if ( ! function_exists('CMS') ) {

// Register Custom Post Type
function CMS() {

	$labels = array(
		'name'                => _x( 'All CMS', 'Post Type General Name', 'text_domain' ),
		'singular_name'       => _x( 'CMS', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'           => __( 'CMS', 'text_domain' ),
		'name_admin_bar'      => __( 'CMS-cpt', 'text_domain' ),
		'parent_item_colon'   => __( 'Parent cms:', 'text_domain' ),
		'all_items'           => __( 'All cms', 'text_domain' ),
		'add_new_item'        => __( 'Add New cms', 'text_domain' ),
		'add_new'             => __( 'Add New cms', 'text_domain' ),
		'new_item'            => __( 'New cms', 'text_domain' ),
		'edit_item'           => __( 'Edit cms', 'text_domain' ),
		'update_item'         => __( 'Update cms', 'text_domain' ),
		'view_item'           => __( 'View cms', 'text_domain' ),
		'search_items'        => __( 'Search cms', 'text_domain' ),
		'not_found'           => __( 'cms Not found', 'text_domain' ),
		'not_found_in_trash'  => __( 'cms Not found in Trash', 'text_domain' ),
	);
	$args = array(
		'label'               => __( 'cms', 'text_domain' ),
		'description'         => __( 'all CMS', 'text_domain' ),
		'labels'              => $labels,
		'supports'            => array( ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'menu_position'       => 5,
		'menu_icon'           => 'dashicons-format-status',
		'show_in_admin_bar'   => true,
		'show_in_nav_menus'   => true,
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'query_var'           => 'post_type',
		'capability_type'     => 'post',
	);
	register_post_type( 'cms', $args );

}

// Hook into the 'init' action
add_action( 'init', 'CMS', 0 );

}