{"id":1896653,"date":"2019-10-18T13:19:46","date_gmt":"2019-10-18T17:19:46","guid":{"rendered":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/events-calendar-pro-location-search-2\/"},"modified":"2024-02-29T15:46:26","modified_gmt":"2024-02-29T20:46:26","slug":"events-calendar-pro-location-search","status":"publish","type":"post","link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/events-calendar-pro-location-search\/","title":{"rendered":"Using Location Search"},"content":{"rendered":"\n<p>One of the many great features exclusive to&nbsp;<a href=\"https:\/\/theeventscalendar.com\/product\/wordpress-events-calendar-pro\/\" target=\"_blank\" rel=\"noreferrer noopener\">Events Calendar Pro<\/a> is the ability to perform smart location-based searches when filtering calendar events. When viewing the main calendar page of a site that&#8217;s running Events Calendar Pro, you&#8217;ll see an additional option located next to the fields for month- and keyword-based searches.<\/p>\n\n\n\n<p>Before you begin, <a aria-label=\" (opens in a new tab)\" href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/setting-up-your-google-maps-api-key\/\" target=\"_blank\" rel=\"noreferrer noopener\">please review this article<\/a> about setting up your Google Maps API Key. If you do not run through those steps, you may not be able to take advantage of the functionality described here.<\/p>\n\n\n\n<p>If you are interested in how location search works more in-depth, then we recommend reading <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/how-location-search-works-in-events-calendar-pro\/\">this article<\/a> about it as well.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/06\/Screen-Shot-2021-06-11-at-1.41.55-PM.png\" alt=\"Location search in the events bar\" class=\"wp-image-1949940\"\/><\/figure>\n\n\n\n<p class=\"has-background\" style=\"background-color:var(--global-palette8)\"><strong>Note:<\/strong> Only one venue will be visible on the map if you are using the built-in API key. To display more venues, you&#8217;ll need to create a custom API key. See <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/setting-up-your-google-maps-api-key\/\" target=\"_blank\" rel=\"noreferrer noopener\">this Knowledgebase article<\/a> for more information.<\/p>\n\n\n\n<p>Expanding on the basic venue options that are provided for calendar events in The Events Calendar, Events Calendar Pro includes support for <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/venue-and-organizer-pages\/\" target=\"_blank\" rel=\"noreferrer noopener\">saved venues<\/a> and geolocation data. This geolocation data is precisely what enables the powerful location search capabilities of Pro, making it easier than ever for your users to find local events that match their interests.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"basics\">Basic Searching<\/h3>\n\n\n\n<p>For demonstration purposes, let&#8217;s try a basic search on our <a data-type=\"URL\" data-id=\"https:\/\/demo.theeventscalendar.com\" href=\"https:\/\/demo.theeventscalendar.com\" target=\"_blank\" rel=\"noreferrer noopener\">Demo Site using <\/a>Map View. When accessing your main calendar page in Map View, you&#8217;ll see all of your events plotted on a large map based on their venue location.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/06\/Screen-Shot-2021-06-11-at-1.44.11-PM.png\" alt=\"Map View with The Events Calendar\" class=\"wp-image-1949942\"\/><\/figure>\n\n\n\n<p>Simply enter an address, city, or other mappable location into the <strong>In a location<\/strong> field, then click the <strong>Find Events<\/strong> button to process your search. After a few moments, your map and the event listings below will refresh, and you&#8217;ll be presented with a smaller selection of nearby events (if any events are found within the specified radius).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/06\/Screen-Shot-2021-06-11-at-1.47.31-PM.png\" alt=\"Enter an address in the events bar to enable location search\" class=\"wp-image-1949943\"\/><\/figure>\n\n\n\n<p>This feature can be used for filtering events on any calendar view and works great with our <a href=\"https:\/\/theeventscalendar.com\/product\/wordpress-events-filterbar\/\" target=\"_blank\" rel=\"noreferrer noopener\">Filter Bar<\/a> add-on for even more precise filtering capabilities. When Filter Bar is used in tandem with Events Calendar Pro, you can adjust the radius for your location-based searches by using the <strong>Distance<\/strong> filter. This can be helpful if, for example, you&#8217;d like to search for events across multiple nearby metro areas, or if you&#8217;re looking to filter a calendar with a large number of events to display only those closest to your location.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/06\/Screen-Shot-2021-06-11-at-1.50.19-PM.png\" alt=\"Use the distance filter available with Filter Bar to enhance location search\" class=\"wp-image-1949944\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"taking-it-further\">Taking it Further<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"hide-search\">Hiding the Location Search Field<\/h4>\n\n\n\n<p>By default, the location search field is displayed in the Event Search Bar for all calendar views, including List, Month, Day, Week, Map, and Photo. If you&#8217;d prefer to limit location-based searches to map-based views only, you can achieve this with a simple settings toggle.<\/p>\n\n\n\n<p>After logging in to your WordPress site&#8217;s admin, navigate to <strong>Events<\/strong> &gt; <strong>Settings<\/strong>from the WordPress sidebar and click the <strong>Display<\/strong> tab. You&#8217;ll find the checkbox for&nbsp;<strong>Hide location search<\/strong> under the&nbsp;<strong>Calendar Display<\/strong> heading.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/06\/Screen-Shot-2021-06-11-at-1.51.42-PM.png\" alt=\"Option to Hide location search under Events Settings \" class=\"wp-image-1949945\"\/><\/figure>\n\n\n\n<p>Select this box and click the <strong>Save Changes<\/strong> button at the bottom of the settings page once you&#8217;re finished. Your changes will be applied immediately to your calendar views, and you&#8217;ll no longer see the location search option on non-map-based views. <strong>Please Note:<\/strong> This setting will only show up if you have a Custom API enabled in your settings. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/06\/Screen-Shot-2021-06-11-at-1.52.56-PM.png\" alt=\"You will no longer see the location search once you disable the setting\" class=\"wp-image-1949946\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"wp-query\">Filtering Events by Location with WP_Query<\/h4>\n\n\n\n<p>If you&#8217;ve ever used <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/crafting-custom-event-queries\/\" target=\"_blank\" rel=\"noreferrer noopener\">WP_Query<\/a> or our own <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/using-tribe_get_events\/\" target=\"_blank\" rel=\"noreferrer noopener\">tribe_get_events()<\/a> function to create a customized display of event data, you&#8217;ll be pleased to know that we&#8217;ve recently added support for location-based filters in these queries! Beginning with Events Calendar Pro version 4.4.16, the arguments&nbsp;<strong>tribe_geoloc<\/strong>, <strong>tribe_geoloc_lat<\/strong>, and <strong>tribe_geoloc_lng<\/strong> are available for writing into your custom queries. For more information on location-specific and other changes added in this release, check out our complete release notes <a href=\"https:\/\/theeventscalendar.com\/maintenance-release-week-21-august-2017\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Troubleshooting the location search<\/h3>\n\n\n\n<p>If you are outside of the United States, you may find that the location search doesn&#8217;t work as expected. In order to resolve this issue, you can add the snippet in <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/change-the-google-maps-localization-option\/\" target=\"_blank\" rel=\"noreferrer noopener\">this Knowledgebase article<\/a> to change the default location to your current location.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>We hope that this post helps to give you a solid understanding of how our location searches work and how your users can leverage this feature to make better use of your calendars! As always, if you should have any questions, we&#8217;re just a click away over at&nbsp;<a href=\"https:\/\/support.theeventscalendar.com\/submit_ticket\" target=\"_blank\" rel=\"noreferrer noopener\">our help desk<\/a>&#8211;please don&#8217;t hesitate to pay us a visit!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the many great features exclusive to&nbsp;Events Calendar Pro is the ability to perform smart location-based searches when filtering calendar events. When viewing the main calendar page of a site that&#8217;s running Events Calendar Pro, you&#8217;ll see an additional option located next to the fields for month- and keyword-based searches. Before you begin, please&#8230;<\/p>\n","protected":false},"author":5,"featured_media":1955565,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[74],"tags":[42],"stellar-product-taxonomy":[158],"class_list":["post-1896653","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-filter-bar","tag-google-maps","stellar-product-taxonomy-events-calendar-pro"],"acf":[],"taxonomy_info":{"category":[{"value":74,"label":"Search Filters"}],"post_tag":[{"value":42,"label":"Google Maps"}],"stellar-product-taxonomy":[{"value":158,"label":"Events Calendar Pro"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Leah","author_link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/author\/leahk\/"},"comment_info":0,"category_info":[{"term_id":74,"name":"Search Filters","slug":"filter-bar","term_group":0,"term_taxonomy_id":74,"taxonomy":"category","description":"","parent":61,"count":8,"filter":"raw","term_order":"0","cat_ID":74,"category_count":8,"category_description":"","cat_name":"Search Filters","category_nicename":"filter-bar","category_parent":61}],"tag_info":[{"term_id":42,"name":"Google Maps","slug":"google-maps","term_group":0,"term_taxonomy_id":42,"taxonomy":"post_tag","description":"","parent":0,"count":9,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1896653"}],"version-history":[{"count":2,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896653\/revisions"}],"predecessor-version":[{"id":1959525,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896653\/revisions\/1959525"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1896653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1896653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1896653"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1896653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}