Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Custom taxonomy for online tools

if ( ! function_exists( 'tools_taxonomy' ) ) {

// Register Custom Taxonomy
function tools_taxonomy() {

	$labels = array(
		'name'                       => _x( 'Tools Type', 'Taxonomy General Name', 'muhibbullah_ansary' ),
		'singular_name'              => _x( 'Tool Type', 'Taxonomy Singular Name', 'muhibbullah_ansary' ),
		'menu_name'                  => __( 'Tools Type', 'muhibbullah_ansary' ),
		'all_items'                  => __( 'All Tools Type', 'muhibbullah_ansary' ),
		'parent_item'                => __( 'Parent Tools Type', 'muhibbullah_ansary' ),
		'parent_item_colon'          => __( 'Parent Tool Type:', 'muhibbullah_ansary' ),
		'new_item_name'              => __( 'New Tool Type', 'muhibbullah_ansary' ),
		'add_new_item'               => __( 'Add Tool Type', 'muhibbullah_ansary' ),
		'edit_item'                  => __( 'Edit Tool Type', 'muhibbullah_ansary' ),
		'update_item'                => __( 'Update Tool Type', 'muhibbullah_ansary' ),
		'view_item'                  => __( 'View Tool Type', 'muhibbullah_ansary' ),
		'separate_items_with_commas' => __( 'Separate items with commas', 'muhibbullah_ansary' ),
		'add_or_remove_items'        => __( 'Add or remove Tools Type', 'muhibbullah_ansary' ),
		'choose_from_most_used'      => __( 'Most Used Tools Type', 'muhibbullah_ansary' ),
		'popular_items'              => __( 'Popular Tools Type', 'muhibbullah_ansary' ),
		'search_items'               => __( 'Search Tools Type', 'muhibbullah_ansary' ),
		'not_found'                  => __( 'Not Found', 'muhibbullah_ansary' ),
		'no_terms'                   => __( 'No Tools Type', 'muhibbullah_ansary' ),
		'items_list'                 => __( 'Tools Type List', 'muhibbullah_ansary' ),
		'items_list_navigation'      => __( 'Tools Type List Navigation', 'muhibbullah_ansary' ),
	);
	$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( 'tools_type', array( 'online_tools' ), $args );

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

}