{"id":396262,"date":"2014-07-15T10:55:02","date_gmt":"2014-07-15T17:55:02","guid":{"rendered":"http:\/\/tri.be\/support\/forums\/topic\/taxonomy-categories-sub-categories-in-drop-down\/"},"modified":"2014-08-14T09:04:15","modified_gmt":"2014-08-14T16:04:15","slug":"taxonomy-categories-sub-categories-in-drop-down","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/taxonomy-categories-sub-categories-in-drop-down\/","title":{"rendered":"Taxonomy + Categories, sub categories in Drop Down"},"content":{"rendered":"<p>Hello,<\/p>\n<p>With the help of the forum I was able to make my categories in add event submission form show up in a drop down opposed to the check boxes&#8230; however, this drop down does not show any of my Categories only sub categories, which makes it confusing because nothing is organized, and there is duplicate subcategories within all categories&#8230;<\/p>\n<p>for instance<\/p>\n<p>Games<br \/>\n &#8211; cards<br \/>\n &#8211; board games<br \/>\n &#8211; other<\/p>\n<p>sports<br \/>\n &#8211; hockey<br \/>\n -golf<br \/>\n -other<\/p>\n<p>other shows up in the list twice, how can I organize it so that in my drop down, it will show the main category and sub categories below that category and so on for each main category:<\/p>\n<p>Here is the code i am using:<br \/>\n&lt;?php<br \/>\n\t$event_cat_ids = array();<br \/>\n\tif ( $event ) {<br \/>\n\t\t$event_cats = wp_get_object_terms( $event-&gt;ID, TribeEvents::TAXONOMY );<br \/>\n\t\tforeach ( $event_cats as $event_cat ) {<br \/>\n\t\t\t$event_cat_ids[] = $event_cat-&gt;term_id;<br \/>\n\t\t}<br \/>\n\t} else {<br \/>\n\t\t$event_cats = array();<br \/>\n\t}<br \/>\n\t$args = array(<br \/>\n\t\t&#8216;hide_empty&#8217; =&gt; false,<br \/>\n\t\t&#8216;orderby&#8217; =&gt; &#8216;name&#8217;,<br \/>\n\t\t&#8216;order&#8217; =&gt; &#8216;ASC&#8217;,<br \/>\n\t\t&#8216;exclude&#8217; =&gt; $event_cat_ids,<br \/>\n\t);<\/p>\n<p>\t$cats = get_terms( TribeEvents::TAXONOMY, $args );<br \/>\n\t$cats = array_merge( $event_cats, $cats );<br \/>\n\t$cats = apply_filters( &#8216;tribe_community_events_event_categories&#8217;, $cats );<\/p>\n<p>\techo &#8216;&lt;select name=&#8221;tax_input[tribe_events_cat][]&#8221;&gt;&#8217;;<br \/>\n\techo &#8216;&lt;option&gt; Select a category &lt;\/option&gt;&#8217;;<\/p>\n<p>\tforeach ($cats as $cat)<br \/>\n\t\techo &#8216;&lt;option value=&#8221;&#8216;.esc_attr($cat-&gt;term_id).'&#8221;&gt;&#8217;.esc_html($cat-&gt;name).'&lt;\/option&gt;&#8217;;<\/p>\n<p>\techo &#8216;&lt;\/select&gt;&#8217;;<br \/>\n?&gt;<\/p>\n","protected":false},"template":"","class_list":["post-396262","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>Taxonomy + Categories, sub categories in Drop Down -<\/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\/taxonomy-categories-sub-categories-in-drop-down\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Taxonomy + Categories, sub categories in Drop Down -\" \/>\n<meta property=\"og:description\" content=\"Hello, With the help of the forum I was able to make my categories in add event submission form show up in a drop down opposed to the check boxes&#8230; however, this drop down does not show any of my Categories only sub categories, which makes it confusing because nothing is organized, and there is [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/taxonomy-categories-sub-categories-in-drop-down\/\" \/>\n<meta property=\"article:modified_time\" content=\"2014-08-14T16:04:15+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\/taxonomy-categories-sub-categories-in-drop-down\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/taxonomy-categories-sub-categories-in-drop-down\/\",\"name\":\"Taxonomy + Categories, sub categories in Drop Down -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2014-07-15T17:55:02+00:00\",\"dateModified\":\"2014-08-14T16:04:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/taxonomy-categories-sub-categories-in-drop-down\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/taxonomy-categories-sub-categories-in-drop-down\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/taxonomy-categories-sub-categories-in-drop-down\/#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\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Community Events\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Taxonomy + Categories, sub categories in Drop Down\"}]},{\"@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":"Taxonomy + Categories, sub categories in Drop Down -","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\/taxonomy-categories-sub-categories-in-drop-down\/","og_locale":"en_US","og_type":"article","og_title":"Taxonomy + Categories, sub categories in Drop Down -","og_description":"Hello, With the help of the forum I was able to make my categories in add event submission form show up in a drop down opposed to the check boxes&#8230; however, this drop down does not show any of my Categories only sub categories, which makes it confusing because nothing is organized, and there is [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/taxonomy-categories-sub-categories-in-drop-down\/","article_modified_time":"2014-08-14T16:04:15+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\/taxonomy-categories-sub-categories-in-drop-down\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/taxonomy-categories-sub-categories-in-drop-down\/","name":"Taxonomy + Categories, sub categories in Drop Down -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2014-07-15T17:55:02+00:00","dateModified":"2014-08-14T16:04:15+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/taxonomy-categories-sub-categories-in-drop-down\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/taxonomy-categories-sub-categories-in-drop-down\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/taxonomy-categories-sub-categories-in-drop-down\/#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":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Community Events","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/"},{"@type":"ListItem","position":5,"name":"Taxonomy + Categories, sub categories in Drop Down"}]},{"@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\/396262","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":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/396262\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=396262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}