Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

LeagueCMS Gallery

// Register Custom Post Type
function custom_post_type() {

	$labels = array(
		'name'                => _x( 'Galleries', 'Post Type General Name', 'leaguecms-gallery' ),
		'singular_name'       => _x( 'Gallery', 'Post Type Singular Name', 'leaguecms-gallery' ),
		'menu_name'           => __( 'Galleries', 'leaguecms-gallery' ),
		'parent_item_colon'   => __( 'Parent Gallery:', 'leaguecms-gallery' ),
		'all_items'           => __( 'All Galleries', 'leaguecms-gallery' ),
		'view_item'           => __( 'View Gallery', 'leaguecms-gallery' ),
		'add_new_item'        => __( 'Create New Gallery', 'leaguecms-gallery' ),
		'add_new'             => __( 'Create Gallery', 'leaguecms-gallery' ),
		'edit_item'           => __( 'Edit Gallery', 'leaguecms-gallery' ),
		'update_item'         => __( 'Update Gallery', 'leaguecms-gallery' ),
		'search_items'        => __( 'Search Galleries', 'leaguecms-gallery' ),
		'not_found'           => __( 'Not found', 'leaguecms-gallery' ),
		'not_found_in_trash'  => __( 'Not found in Trash', 'leaguecms-gallery' ),
	);
	$args = array(
		'label'               => __( 'leaguecms-gallery', 'leaguecms-gallery' ),
		'description'         => __( 'Create and manage image galleries', 'leaguecms-gallery' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', ),
		'taxonomies'          => array( 'category', 'post_tag' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'show_in_admin_bar'   => true,
		'menu_position'       => 25,
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'capability_type'     => 'page',
	);
	register_post_type( 'leaguecms-gallery', $args );

}

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