Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Album post type

// Register Custom Post Type
function hrm_album() {

	$labels = array(
		'name'                => _x( 'Albums', 'Post Type General Name', 'hrm' ),
		'singular_name'       => _x( 'Album', 'Post Type Singular Name', 'hrm' ),
		'menu_name'           => __( 'Album', 'hrm' ),
		'name_admin_bar'      => __( 'Album', 'hrm' ),
		'parent_item_colon'   => __( 'Album Cha:', 'hrm' ),
		'all_items'           => __( 'Tất Cả Album', 'hrm' ),
		'add_new_item'        => __( 'Thêm Album Mới', 'hrm' ),
		'add_new'             => __( 'Thêm Mới', 'hrm' ),
		'new_item'            => __( 'Album Mới', 'hrm' ),
		'edit_item'           => __( 'Sửa Album', 'hrm' ),
		'update_item'         => __( 'Cập Nhật Album', 'hrm' ),
		'view_item'           => __( 'Xem Album', 'hrm' ),
		'search_items'        => __( 'Tìm Kiếm Album', 'hrm' ),
		'not_found'           => __( 'Không tìm thấy', 'hrm' ),
		'not_found_in_trash'  => __( 'Không có album nào trong thùng rác', 'hrm' ),
	);
	$args = array(
		'label'               => __( 'album', 'hrm' ),
		'description'         => __( 'Album ảnh', 'hrm' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'thumbnail', 'revisions', ),
		'taxonomies'          => array( 'gallery' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'menu_position'       => 5,
		'menu_icon'           => 'dashicons-format-gallery',
		'show_in_admin_bar'   => true,
		'show_in_nav_menus'   => true,
		'can_export'          => true,
		'has_archive'         => true,		
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'capability_type'     => 'page',
	);
	register_post_type( 'album', $args );

}

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