Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Site Category

if ( ! function_exists( 'anp_site_category' ) ) {

// Register Custom Taxonomy
function anp_site_category() {

	$labels = array(
		'name'                       => _x( 'Site Categories', 'Taxonomy General Name', 'anp_site_category' ),
		'singular_name'              => _x( 'Site Category', 'Taxonomy Singular Name', 'anp_site_category' ),
		'menu_name'                  => __( 'Site Category', 'anp_site_category' ),
		'all_items'                  => __( 'All Site Categories', 'anp_site_category' ),
		'parent_item'                => __( 'Parent Site Category', 'anp_site_category' ),
		'parent_item_colon'          => __( 'Parent Site Category:', 'anp_site_category' ),
		'new_item_name'              => __( 'New Site Category', 'anp_site_category' ),
		'add_new_item'               => __( 'Add Site Category', 'anp_site_category' ),
		'edit_item'                  => __( 'Edit Site Category', 'anp_site_category' ),
		'update_item'                => __( 'Update Site Category', 'anp_site_category' ),
		'view_item'                  => __( 'View Site Category', 'anp_site_category' ),
		'separate_items_with_commas' => __( 'Separate site categories with commas', 'anp_site_category' ),
		'add_or_remove_items'        => __( 'Add or remove site categories', 'anp_site_category' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'anp_site_category' ),
		'popular_items'              => __( 'Popular Site Categories', 'anp_site_category' ),
		'search_items'               => __( 'Search Site Categories', 'anp_site_category' ),
		'not_found'                  => __( 'Not Found', 'anp_site_category' ),
		'items_list'                 => __( 'Site categories list', 'anp_site_category' ),
		'items_list_navigation'      => __( 'Site sategories list navigation', 'anp_site_category' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
	);
	register_taxonomy( 'site_category', array( '' ), $args );

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

}