{"id":2093,"date":"2014-12-29T07:21:43","date_gmt":"2014-12-29T07:21:43","guid":{"rendered":"http:\/\/www.vishmax.com\/en\/?p=2093"},"modified":"2014-12-29T07:21:43","modified_gmt":"2014-12-29T07:21:43","slug":"how-to-create-custom-taxonomies-in-wordpress","status":"publish","type":"post","link":"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/","title":{"rendered":"How to create custom taxonomies in WordPress"},"content":{"rendered":"<p>Custom taxonomies are a core feature introduced in WordPress ver.3 and 3.1 included many enhancements to support custom taxonomies. There are four built-in taxonomies in WordPress which are Categories,Tags,Links and Navigation menu respectively.<\/p>\n<p>Besides that creating your own custom taxonomies will allow you to group content in a new way. In WordPress you can create \/register a new taxonomy by using the register_taxonomy() function. Here is simple example code for creating custom taxonomies. Copy below code to your functions.php of your wordpress theme and it will create custom taxonomies.<\/p>\n<pre lang=\"php\">\r\n\r\n<?php\r\n\r\n\/\/create a function that will attach our new 'member' taxonomy to the 'post' post type\r\nfunction add_member_taxonomy_to_post(){\r\n \r\n    \/\/set the name of the taxonomy\r\n    $taxonomy = 'member';\r\n    \/\/set the post types for the taxonomy\r\n    $object_type = 'post';\r\n     \r\n    \/\/populate our array of names for our taxonomy\r\n    $labels = array(\r\n        'name'               => 'Members',\r\n        'singular_name'      => 'Member',\r\n        'search_items'       => 'Search Members',\r\n        'all_items'          => 'All Members',\r\n        'parent_item'        => 'Parent Member',\r\n        'parent_item_colon'  => 'Parent Member:',\r\n        'update_item'        => 'Update Member',\r\n        'edit_item'          => 'Edit Member',\r\n        'add_new_item'       => 'Add New Member', \r\n        'new_item_name'      => 'New Member Name',\r\n        'menu_name'          => 'Member'\r\n    );\r\n     \r\n    \/\/define arguments to be used \r\n    $args = array(\r\n        'labels'            => $labels,\r\n        'hierarchical'      => true,\r\n        'show_ui'           => true,\r\n        'how_in_nav_menus'  => true,\r\n        'public'            => true,\r\n        'show_admin_column' => true,\r\n        'query_var'         => true,\r\n        'rewrite'           => array('slug' => 'member')\r\n    );\r\n     \r\n    \/\/call the register_taxonomy function\r\n    register_taxonomy($taxonomy, $object_type, $args); \r\n}\r\nadd_action('init','add_member_taxonomy_to_post'); \r\n\r\n?>\r\n\r\n<\/pre>\n<p>You can read more at <a href=\"http:\/\/codex.wordpress.org\/Taxonomies\" title=\"Taxonomies\" target=\"_blank\">here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Custom taxonomies are a core feature introduced in WordPress ver.3 and 3.1 included many enhancements to support custom taxonomies. There are four built-in taxonomies in WordPress which are Categories,Tags,Links and Navigation menu respectively. Besides that creating your own custom taxonomies will allow you to group content in a new way. In WordPress you can create [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[44],"tags":[72,83],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to create custom taxonomies in WordPress - Vishmax.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to create custom taxonomies in WordPress - Vishmax.com\" \/>\n<meta property=\"og:description\" content=\"Custom taxonomies are a core feature introduced in WordPress ver.3 and 3.1 included many enhancements to support custom taxonomies. There are four built-in taxonomies in WordPress which are Categories,Tags,Links and Navigation menu respectively. Besides that creating your own custom taxonomies will allow you to group content in a new way. In WordPress you can create [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Vishmax.com\" \/>\n<meta property=\"article:published_time\" content=\"2014-12-29T07:21:43+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/www.vishmax.com\/en\/#\/schema\/person\/785fa94b56eb17ae7706d30777d6ab93\"},\"headline\":\"How to create custom taxonomies in WordPress\",\"datePublished\":\"2014-12-29T07:21:43+00:00\",\"dateModified\":\"2014-12-29T07:21:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/\"},\"wordCount\":105,\"publisher\":{\"@id\":\"https:\/\/www.vishmax.com\/en\/#organization\"},\"keywords\":[\"Code Library\",\"WP Snippets\"],\"articleSection\":[\"Labs\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/\",\"url\":\"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/\",\"name\":\"How to create custom taxonomies in WordPress - Vishmax.com\",\"isPartOf\":{\"@id\":\"https:\/\/www.vishmax.com\/en\/#website\"},\"datePublished\":\"2014-12-29T07:21:43+00:00\",\"dateModified\":\"2014-12-29T07:21:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vishmax.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to create custom taxonomies in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vishmax.com\/en\/#website\",\"url\":\"https:\/\/www.vishmax.com\/en\/\",\"name\":\"Vishmax.com\",\"description\":\"Software Company in Calicut for Web Design and eCommerce\",\"publisher\":{\"@id\":\"https:\/\/www.vishmax.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vishmax.com\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vishmax.com\/en\/#organization\",\"name\":\"Vishmax.com\",\"url\":\"https:\/\/www.vishmax.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vishmax.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vishmax.com\/en\/wp-content\/uploads\/2023\/03\/logo-vishmax.png\",\"contentUrl\":\"https:\/\/www.vishmax.com\/en\/wp-content\/uploads\/2023\/03\/logo-vishmax.png\",\"width\":150,\"height\":50,\"caption\":\"Vishmax.com\"},\"image\":{\"@id\":\"https:\/\/www.vishmax.com\/en\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.vishmax.com\/en\/#\/schema\/person\/785fa94b56eb17ae7706d30777d6ab93\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vishmax.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e218268870406c917d20b442936d9e68?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e218268870406c917d20b442936d9e68?s=96&d=monsterid&r=g\",\"caption\":\"admin\"},\"url\":\"https:\/\/www.vishmax.com\/en\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to create custom taxonomies in WordPress - Vishmax.com","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"How to create custom taxonomies in WordPress - Vishmax.com","og_description":"Custom taxonomies are a core feature introduced in WordPress ver.3 and 3.1 included many enhancements to support custom taxonomies. There are four built-in taxonomies in WordPress which are Categories,Tags,Links and Navigation menu respectively. Besides that creating your own custom taxonomies will allow you to group content in a new way. In WordPress you can create [&hellip;]","og_url":"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/","og_site_name":"Vishmax.com","article_published_time":"2014-12-29T07:21:43+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/#article","isPartOf":{"@id":"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/"},"author":{"name":"admin","@id":"https:\/\/www.vishmax.com\/en\/#\/schema\/person\/785fa94b56eb17ae7706d30777d6ab93"},"headline":"How to create custom taxonomies in WordPress","datePublished":"2014-12-29T07:21:43+00:00","dateModified":"2014-12-29T07:21:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/"},"wordCount":105,"publisher":{"@id":"https:\/\/www.vishmax.com\/en\/#organization"},"keywords":["Code Library","WP Snippets"],"articleSection":["Labs"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/","url":"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/","name":"How to create custom taxonomies in WordPress - Vishmax.com","isPartOf":{"@id":"https:\/\/www.vishmax.com\/en\/#website"},"datePublished":"2014-12-29T07:21:43+00:00","dateModified":"2014-12-29T07:21:43+00:00","breadcrumb":{"@id":"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vishmax.com\/en\/labs\/how-to-create-custom-taxonomies-in-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vishmax.com\/en\/"},{"@type":"ListItem","position":2,"name":"How to create custom taxonomies in WordPress"}]},{"@type":"WebSite","@id":"https:\/\/www.vishmax.com\/en\/#website","url":"https:\/\/www.vishmax.com\/en\/","name":"Vishmax.com","description":"Software Company in Calicut for Web Design and eCommerce","publisher":{"@id":"https:\/\/www.vishmax.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vishmax.com\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vishmax.com\/en\/#organization","name":"Vishmax.com","url":"https:\/\/www.vishmax.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vishmax.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.vishmax.com\/en\/wp-content\/uploads\/2023\/03\/logo-vishmax.png","contentUrl":"https:\/\/www.vishmax.com\/en\/wp-content\/uploads\/2023\/03\/logo-vishmax.png","width":150,"height":50,"caption":"Vishmax.com"},"image":{"@id":"https:\/\/www.vishmax.com\/en\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.vishmax.com\/en\/#\/schema\/person\/785fa94b56eb17ae7706d30777d6ab93","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vishmax.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e218268870406c917d20b442936d9e68?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e218268870406c917d20b442936d9e68?s=96&d=monsterid&r=g","caption":"admin"},"url":"https:\/\/www.vishmax.com\/en\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/posts\/2093"}],"collection":[{"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/comments?post=2093"}],"version-history":[{"count":0,"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/posts\/2093\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/media?parent=2093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/categories?post=2093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/tags?post=2093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}