Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Alumni Post Type

if ( ! function_exists('sgu_theme_alumni') ) {

// Register Custom Post Type
function sgu_theme_alumni() {

	$labels = array(
		'name'                => _x( 'Alumni', 'Post Type General Name', 'sgu_theme' ),
		'singular_name'       => _x( 'Alumnus', 'Post Type Singular Name', 'sgu_theme' ),
		'menu_name'           => __( 'Alumni', 'sgu_theme' ),
		'parent_item_colon'   => __( 'Parent Alumni:', 'sgu_theme' ),
		'all_items'           => __( 'All Alumni', 'sgu_theme' ),
		'view_item'           => __( 'View Alumnus', 'sgu_theme' ),
		'add_new_item'        => __( 'Add New Alumnus', 'sgu_theme' ),
		'add_new'             => __( 'Add New', 'sgu_theme' ),
		'edit_item'           => __( 'Edit Alumnus', 'sgu_theme' ),
		'update_item'         => __( 'Update Alumnus', 'sgu_theme' ),
		'search_items'        => __( 'Search Alumni', 'sgu_theme' ),
		'not_found'           => __( 'Alumni not found', 'sgu_theme' ),
		'not_found_in_trash'  => __( 'Alumni not found in Trash', 'sgu_theme' ),
	);
	$args = array(
		'label'               => __( 'alumni', 'sgu_theme' ),
		'description'         => __( 'University Alumni', 'sgu_theme' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'thumbnail', 'revisions', ),
		'taxonomies'          => array( 'country' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'show_in_admin_bar'   => true,
		'menu_position'       => 20,
		'menu_icon'           => 'dashicons-welcome-learn-more',
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'capability_type'     => 'page',
	);
	register_post_type( 'alumni', $args );

}

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

}