{"id":1410649,"date":"2017-12-21T02:32:48","date_gmt":"2017-12-21T10:32:48","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/"},"modified":"2017-12-21T09:19:49","modified_gmt":"2017-12-21T17:19:49","slug":"i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/","title":{"rendered":"I am creating a custom taxonomy but having some errors. Need help"},"content":{"rendered":"<p>I have been adding the code in functions.php but still i am having some errors as i don&#8217;t know what i have done wrong. I have seen the code from https:\/\/www.wpblog.com\/create-custom-taxonomies-in-wordpress\/<\/p>\n<p><code>add_action( 'init', 'create_cw_hierarchical_taxonomy', 0 );<br \/>\n\/\/create a custom taxonomy name<br \/>\nfunction create_cw_hierarchical_taxonomy() {<br \/>\n$labels = array(<br \/>\n'name' =&amp;gt; _x( 'Topics', 'taxonomy general name' ),<br \/>\n'singular_name' =&amp;gt; _x( 'Topic', 'taxonomy singular name' ),<br \/>\n'search_items' =&amp;gt; __( 'Search Topics' ),<br \/>\n'all_items' =&amp;gt; __( 'All Topics' ),<br \/>\n'parent_item' =&amp;gt; __( 'Parent Topic' ),<br \/>\n'parent_item_colon' =&amp;gt; __( 'Parent Topic:' ),<br \/>\n'edit_item' =&amp;gt; __( 'Edit Topic' ),<br \/>\n'update_item' =&amp;gt; __( 'Update Topic' ),<br \/>\n'add_new_item' =&amp;gt; __( 'Add New Topic' ),<br \/>\n'new_item_name' =&amp;gt; __( 'New Topic Name' ),<br \/>\n'menu_name' =&amp;gt; __( 'Topics' ),<br \/>\n);<br \/>\n\/\/ taxonomy register<br \/>\nregister_taxonomy('topics',array('post'), array(<br \/>\n'hierarchical' =&amp;gt; true,<br \/>\n'labels' =&amp;gt; $labels,<br \/>\n'show_ui' =&amp;gt; true,<br \/>\n'show_admin_column' =&amp;gt; true,<br \/>\n'query_var' =&amp;gt; true,<br \/>\n'rewrite' =&amp;gt; array( 'slug' =&amp;gt; 'topic' ),<br \/>\n));<br \/>\n}<\/code><\/p>\n","protected":false},"template":"","class_list":["post-1410649","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>I am creating a custom taxonomy but having some errors. Need help -<\/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:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"I am creating a custom taxonomy but having some errors. Need help -\" \/>\n<meta property=\"og:description\" content=\"I have been adding the code in functions.php but still i am having some errors as i don&#8217;t know what i have done wrong. I have seen the code from https:\/\/www.wpblog.com\/create-custom-taxonomies-in-wordpress\/ add_action( &#039;init&#039;, &#039;create_cw_hierarchical_taxonomy&#039;, 0 ); \/\/create a custom taxonomy name function create_cw_hierarchical_taxonomy() { $labels = array( &#039;name&#039; =&amp;gt; _x( &#039;Topics&#039;, &#039;taxonomy general name&#039; ), [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-21T17:19:49+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/\",\"name\":\"I am creating a custom taxonomy but having some errors. Need help -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-12-21T10:32:48+00:00\",\"dateModified\":\"2017-12-21T17:19:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Welcome!\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Pre-Sales Questions\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/pre-sales-questions\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"I am creating a custom taxonomy but having some errors. Need help\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"I am creating a custom taxonomy but having some errors. Need help -","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:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/","og_locale":"en_US","og_type":"article","og_title":"I am creating a custom taxonomy but having some errors. Need help -","og_description":"I have been adding the code in functions.php but still i am having some errors as i don&#8217;t know what i have done wrong. I have seen the code from https:\/\/www.wpblog.com\/create-custom-taxonomies-in-wordpress\/ add_action( 'init', 'create_cw_hierarchical_taxonomy', 0 ); \/\/create a custom taxonomy name function create_cw_hierarchical_taxonomy() { $labels = array( 'name' =&amp;gt; _x( 'Topics', 'taxonomy general name' ), [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/","article_modified_time":"2017-12-21T17:19:49+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/","name":"I am creating a custom taxonomy but having some errors. Need help -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-12-21T10:32:48+00:00","dateModified":"2017-12-21T17:19:49+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-am-creating-a-custom-taxonomy-but-having-some-errors-need-help\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Welcome!","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/"},{"@type":"ListItem","position":4,"name":"Pre-Sales Questions","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/pre-sales-questions\/"},{"@type":"ListItem","position":5,"name":"I am creating a custom taxonomy but having some errors. Need help"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1410649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1410649\/revisions"}],"predecessor-version":[{"id":1411022,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1410649\/revisions\/1411022"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1410649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}