Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

GSAB Board Directory

if ( ! function_exists('geosci_board') ) {

// Register Custom Post Type
function geosci_board() {

	$labels = array(
		'name'                  => _x( 'Board Members', 'Post Type General Name', 'geosci' ),
		'singular_name'         => _x( 'Board Member', 'Post Type Singular Name', 'geosci' ),
		'menu_name'             => __( 'Board Members', 'geosci' ),
		'name_admin_bar'        => __( 'Board Member', 'geosci' ),
		'archives'              => __( 'Board Member Archives', 'geosci' ),
		'attributes'            => __( 'Board Member Attributes', 'geosci' ),
		'parent_item_colon'     => __( 'Parent Item:', 'geosci' ),
		'all_items'             => __( 'All Board Members', 'geosci' ),
		'add_new_item'          => __( 'Add New Board Member', 'geosci' ),
		'add_new'               => __( 'Add New', 'geosci' ),
		'new_item'              => __( 'New Board Member', 'geosci' ),
		'edit_item'             => __( 'Edit Board Member', 'geosci' ),
		'update_item'           => __( 'Update Board Member', 'geosci' ),
		'view_item'             => __( 'View Board Member', 'geosci' ),
		'view_items'            => __( 'View Board Members', 'geosci' ),
		'search_items'          => __( 'Search Board Member', 'geosci' ),
		'not_found'             => __( 'Not found', 'geosci' ),
		'not_found_in_trash'    => __( 'Not found in Trash', 'geosci' ),
		'featured_image'        => __( 'Featured Image', 'geosci' ),
		'set_featured_image'    => __( 'Set featured image', 'geosci' ),
		'remove_featured_image' => __( 'Remove featured image', 'geosci' ),
		'use_featured_image'    => __( 'Use as featured image', 'geosci' ),
		'insert_into_item'      => __( 'Insert into item', 'geosci' ),
		'uploaded_to_this_item' => __( 'Uploaded to this item', 'geosci' ),
		'items_list'            => __( 'Items list', 'geosci' ),
		'items_list_navigation' => __( 'Items list navigation', 'geosci' ),
		'filter_items_list'     => __( 'Filter items list', 'geosci' ),
	);
	$rewrite = array(
		'slug'                  => 'board-directory',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => false,
	);
	$capabilities = array(
		'edit_post'             => 'edit_board',
		'read_post'             => 'read_board',
		'delete_post'           => 'delete_board',
		'edit_posts'            => 'edit_boards',
		'edit_others_posts'     => 'edit_others_boards',
		'publish_posts'         => 'publish_boards',
		'read_private_posts'    => 'read_private_boards',
	);
	$args = array(
		'label'                 => __( 'Board Member', 'geosci' ),
		'description'           => __( 'Board Member Directory', 'geosci' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'author', 'thumbnail', 'revisions', 'page-attributes', ),
		'taxonomies'            => array( 'committee' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 20,
		'menu_icon'             => 'dashicons-id-alt',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => false,
		'can_export'            => true,
		'has_archive'           => false,		
		'exclude_from_search'   => true,
		'publicly_queryable'    => true,
		'rewrite'               => $rewrite,
		'capabilities'          => $capabilities,
		'show_in_rest'          => false,
	);
	register_post_type( 'board_member', $args );

}
add_action( 'init', 'geosci_board', 0 );

}