Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Glossary Item

if ( ! function_exists('post_type_glossary') ) {

// Register Custom Post Type
function post_type_glossary() {

	$labels = array(
		'name'                => 'Glossary Terms',
		'singular_name'       => 'Glossary Term',
		'menu_name'           => 'Glossary',
		'parent_item_colon'   => 'Parent Item:',
		'all_items'           => 'All Glossary Items',
		'view_item'           => 'View Glossary Item',
		'add_new_item'        => 'Add New Glossary Item',
		'add_new'             => 'Add New',
		'edit_item'           => 'Edit Glossary Item',
		'update_item'         => 'Update Glossary Item',
		'search_items'        => 'Search Glossary Item',
		'not_found'           => 'Glossary Item Not Found',
		'not_found_in_trash'  => 'Glossary Item Not found in Trash',
	);
	$args = array(
		'label'               => 'pt_glossary',
		'description'         => 'Custom Glossary',
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'author', 'revisions', 'post-formats', ),
		'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'       => 5,
		'menu_icon'           => '',
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'capability_type'     => 'page',
	);
	register_post_type( 'pt_glossary', $args );

}

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

}