{"id":1198237,"date":"2016-11-28T06:37:34","date_gmt":"2016-11-28T14:37:34","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/location-part-of-tribe-events-bar\/"},"modified":"2016-12-16T10:04:43","modified_gmt":"2016-12-16T18:04:43","slug":"location-part-of-tribe-events-bar","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/location-part-of-tribe-events-bar\/","title":{"rendered":"Location part of Tribe Events Bar"},"content":{"rendered":"<p>Using answers in other threads, I&#8217;ve nearly got this sorted, but can&#8217;t quite get it.<\/p>\n<p>I&#8217;m trying to do 2 things:<br \/>\n1. Change the place holder text below the label near to: Enter Your Postcode (because this is a UK based website)<br \/>\n2. Add the word &#8216;miles&#8217; after the number of miles returned by the location search.<\/p>\n<p>Regards 1. &#8211; I have manage to change the label, but it then prevents &#8216;search by location&#8217; from working??<\/p>\n<p>I&#8217;ve added the following to my functions file but changing the placeholder text to &#8216;Enter your Postcode&#8217; for some reason stops the location search from working (when I removed the code from the functions.php it worked fine except the word miles still didn&#8217;t appear. What ever I put in the search box at the moment returns all events.<\/p>\n<p>\/*<br \/>\n* Change labels in Tribe events bar filter<br \/>\n*\/<\/p>\n<p>add_filter( &#8216;tribe-events-bar-filters&#8217;, &#8216;tribe_support_1043886&#8217; );<\/p>\n<p>function tribe_support_1043886( $filters ) {<\/p>\n<p>$value = &#8221;;<\/p>\n<p>if ( ! empty( $_REQUEST[&#8216;tribe-bar-search&#8217;] ) ) {<br \/>\n$value = esc_attr( $_REQUEST[&#8216;tribe-bar-search&#8217;] );<br \/>\n}<\/p>\n<p>$html = sprintf(<br \/>\n&#8216;&lt;input type=&#8221;text&#8221; name=&#8221;tribe-bar-geoloc&#8221; id=&#8221;tribe-bar-geoloc&#8221; value=&#8221;%s&#8221; placeholder=&#8221;%s&#8221;&gt;&#8217;,<br \/>\nesc_attr( $value ),<br \/>\n&#8216;Enter Your Postcode&#8217;<br \/>\n);<\/p>\n<p>$filters[&#8216;tribe-bar-geoloc&#8217;][&#8216;caption&#8217;] = &#8216;Near&#8217;;<br \/>\n$filters[&#8216;tribe-bar-geoloc&#8217;][&#8216;html&#8217;] = $html;<\/p>\n<p>return $filters;<br \/>\n}<\/p>\n<p>\/*<br \/>\n* Change default distance label in Map View<br \/>\n*\/<br \/>\nadd_filter( &#8216;tribe_get_distance_with_unit&#8217;, &#8216;tribe_custom_distance_label&#8217;, 10, 3 );<\/p>\n<p>function tribe_custom_distance_label ( $distance, $distance_in_kms, $unit ) {<br \/>\nreturn &#8216;Distance From Location: &#8216; . $distance . &#8216; &#8216; . $unit;<br \/>\n}<\/p>\n","protected":false},"template":"","class_list":["post-1198237","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>Location part of Tribe Events Bar -<\/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\/location-part-of-tribe-events-bar\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Location part of Tribe Events Bar -\" \/>\n<meta property=\"og:description\" content=\"Using answers in other threads, I&#8217;ve nearly got this sorted, but can&#8217;t quite get it. I&#8217;m trying to do 2 things: 1. Change the place holder text below the label near to: Enter Your Postcode (because this is a UK based website) 2. Add the word &#8216;miles&#8217; after the number of miles returned by the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/location-part-of-tribe-events-bar\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-12-16T18:04:43+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\/location-part-of-tribe-events-bar\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/location-part-of-tribe-events-bar\/\",\"name\":\"Location part of Tribe Events Bar -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-11-28T14:37:34+00:00\",\"dateModified\":\"2016-12-16T18:04:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/location-part-of-tribe-events-bar\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/location-part-of-tribe-events-bar\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/location-part-of-tribe-events-bar\/#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\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Location part of Tribe Events Bar\"}]},{\"@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":"Location part of Tribe Events Bar -","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\/location-part-of-tribe-events-bar\/","og_locale":"en_US","og_type":"article","og_title":"Location part of Tribe Events Bar -","og_description":"Using answers in other threads, I&#8217;ve nearly got this sorted, but can&#8217;t quite get it. I&#8217;m trying to do 2 things: 1. Change the place holder text below the label near to: Enter Your Postcode (because this is a UK based website) 2. Add the word &#8216;miles&#8217; after the number of miles returned by the [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/location-part-of-tribe-events-bar\/","article_modified_time":"2016-12-16T18:04:43+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\/location-part-of-tribe-events-bar\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/location-part-of-tribe-events-bar\/","name":"Location part of Tribe Events Bar -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-11-28T14:37:34+00:00","dateModified":"2016-12-16T18:04:43+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/location-part-of-tribe-events-bar\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/location-part-of-tribe-events-bar\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/location-part-of-tribe-events-bar\/#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":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Location part of Tribe Events Bar"}]},{"@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\/1198237","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\/1198237\/revisions"}],"predecessor-version":[{"id":1207143,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1198237\/revisions\/1207143"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1198237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}