{"id":1616011,"date":"2018-09-07T03:09:44","date_gmt":"2018-09-07T10:09:44","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage\/"},"modified":"2018-09-07T03:09:44","modified_gmt":"2018-09-07T10:09:44","slug":"creating-events-search-form-on-homepage","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage\/","title":{"rendered":"Creating events search form on homepage"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I am currently struggling to implement a search form based off of Events Calender Pro and the filter bar add-on. We purchased the filter bar to make the following process easier but it has proven to be anything but easier.<br \/>\nEssentially I need three fields (Categories, City and Province\/State) with a submit button, naturally. <\/p>\n<p>I have managed to generate the submit button and a categories dropdown which works perfectly, however I can&#8217;t seem to generate the city and Province\/States dropdowns. I know that they are reliant on venues and I have attempted multiple scenarios, but with no success. Could someone please assist with this and guide me in the right direction. Please see below the code I implemented to get the categories dropdown to work.<\/p>\n<p>&lt;?php<br \/>\n\t   $taxonomy     = TribeEvents::TAXONOMY;<br \/>\n\t   $orderby      = &#8216;name&#8217;;<br \/>\n\t   $show_count   = 1;      \/\/ 1 for yes, 0 for no<br \/>\n\t   $pad_counts   = 0;      \/\/ 1 for yes, 0 for no<br \/>\n\t   $hierarchical = 1;      \/\/ 1 for yes, 0 for no<br \/>\n\t   $title        = &#8221;;<\/p>\n<p>\t   $args = array(<br \/>\n\t\t &#8216;taxonomy&#8217;     =&gt; $taxonomy,<br \/>\n\t\t &#8216;orderby&#8217;      =&gt; $orderby,<br \/>\n\t\t &#8216;show_count&#8217;   =&gt; $show_count,<br \/>\n\t\t &#8216;hierarchical&#8217; =&gt; $hierarchical,<br \/>\n\t\t &#8216;title_li&#8217;     =&gt; $title<br \/>\n\t   );<br \/>\n\t   ?&gt;<\/p>\n<p>form code: <\/p>\n<p>&lt;div class=&#8221;categories-container&#8221;&gt;<br \/>\n\t   &lt;?php $cats = get_categories($args); ?&gt;<br \/>\n\t   &lt;select id=&#8221;categories&#8221;&gt;<br \/>\n                    &lt;option selected value=\u201d\u201d disabled&gt;Event Categories&lt;\/option&gt;<br \/>\n\t   &lt;?php foreach ($cats as $cat) : ?&gt;<br \/>\n\t\t   &lt;option value=&#8221;&lt;?php echo get_term_link($cat, $cat-&gt;taxonomy) ?&gt;&#8221;&gt;&lt;?php echo $cat-&gt;name ?&gt;&lt;\/option&gt;<br \/>\n\t   &lt;?php endforeach; ?&gt;<br \/>\n\t   &lt;\/select&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>script:<\/p>\n<p>&lt;script&gt;<br \/>\n\t   jQuery(document).ready(function()<br \/>\n\t   {<br \/>\n\t\t   jQuery(&#8216;#tribe-bar-form&#8217;).submit(function()<br \/>\n\t\t   {<br \/>\n\t\t\t   window.location = jQuery(&#8216;#categories&#8217;).val();<br \/>\n\t\t\t   return false;<br \/>\n\t\t   });<br \/>\n\t   });<br \/>\n&lt;\/script&gt;<\/p>\n<p>Thanks in advance.<\/p>\n<p>Kind Regards<\/p>\n","protected":false},"template":"","class_list":["post-1616011","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>Creating events search form on homepage -<\/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\/creating-events-search-form-on-homepage\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating events search form on homepage -\" \/>\n<meta property=\"og:description\" content=\"Hi, I am currently struggling to implement a search form based off of Events Calender Pro and the filter bar add-on. We purchased the filter bar to make the following process easier but it has proven to be anything but easier. Essentially I need three fields (Categories, City and Province\/State) with a submit button, naturally. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage\/\" \/>\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\/creating-events-search-form-on-homepage\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage\/\",\"name\":\"Creating events search form on homepage -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2018-09-07T10:09:44+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage\/#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\":\"Creating events search form on homepage\"}]},{\"@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":"Creating events search form on homepage -","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\/creating-events-search-form-on-homepage\/","og_locale":"en_US","og_type":"article","og_title":"Creating events search form on homepage -","og_description":"Hi, I am currently struggling to implement a search form based off of Events Calender Pro and the filter bar add-on. We purchased the filter bar to make the following process easier but it has proven to be anything but easier. Essentially I need three fields (Categories, City and Province\/State) with a submit button, naturally. [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage\/","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\/creating-events-search-form-on-homepage\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage\/","name":"Creating events search form on homepage -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2018-09-07T10:09:44+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage\/#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":"Creating events search form on homepage"}]},{"@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\/1616011","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\/1616011\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1616011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}