Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Movies

if ( ! function_exists('movieportal_post_type_movies') ) {

// Register Custom Post Type
function movieportal_post_type_movies() {

	$labels = array(
		'name'                => _x( 'Movies', 'Post Type General Name', 'movieportal' ),
		'singular_name'       => _x( 'Movie', 'Post Type Singular Name', 'movieportal' ),
		'menu_name'           => __( 'Movies', 'movieportal' ),
		'parent_item_colon'   => __( 'Parent Movie:', 'movieportal' ),
		'all_items'           => __( 'All Movies', 'movieportal' ),
		'view_item'           => __( 'View Movie', 'movieportal' ),
		'add_new_item'        => __( 'Add New Movie', 'movieportal' ),
		'add_new'             => __( 'Add New', 'movieportal' ),
		'edit_item'           => __( 'Edit Movie', 'movieportal' ),
		'update_item'         => __( 'Update Movie', 'movieportal' ),
		'search_items'        => __( 'Search Movie', 'movieportal' ),
		'not_found'           => __( 'Not found', 'movieportal' ),
		'not_found_in_trash'  => __( 'Not found in Trash', 'movieportal' ),
	);
	$args = array(
		'label'               => __( 'movies', 'movieportal' ),
		'description'         => __( 'Movies List', 'movieportal' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'thumbnail', 'comments', 'revisions', ),
		'taxonomies'          => array( 'movie-genre' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'show_in_admin_bar'   => true,
		'menu_position'       => 5,
		'menu_icon'           => 'dashicons-video-alt',
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'capability_type'     => 'post',
	);
	register_post_type( 'movies', $args );

}

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

}