{"id":783,"date":"2025-03-24T14:27:40","date_gmt":"2025-03-24T14:27:40","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/gd-near-me-button\/"},"modified":"2025-04-03T15:24:01","modified_gmt":"2025-04-03T14:24:01","slug":"gd-near-me-button","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/location-manager\/gd-near-me-button\/","title":{"rendered":"GD > Near Me Button"},"content":{"rendered":"\n<div class=\"wp-block-blockstrap-blockstrap-widget-alert d-flex align-items-center fade show alert alert-success mb-3\" role=\"alert\"><span class=\"fas fa-check-circle me-2\"><\/span><span class=\"flex-grow-1\">All Widgets come as Widgets, Shortcodes or Blocks. Learn more about our <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/core-widgets\/what-makes-geodirectory-widgets-special\/\">Super Duper Widgets<\/a>.<\/span><\/div>\n\n\n\n<p>The&nbsp; <strong>Near Me Button<\/strong>&nbsp;displays&nbsp;a button that when clicked will get the user&#8217;s geolocation and redirect them to your <strong>location page<\/strong> where listings will be sorted by <strong>distance to the user&#8217;s position<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-blockstrap-blockstrap-widget-alert d-flex align-items-center fade show alert alert-danger mb-3\" role=\"alert\"><span class=\"fas fa-exclamation-triangle me-2\"><\/span><span class=\"flex-grow-1\">Near Me Button <strong>requires HTTPS support for full functionality <\/strong>otherwise a user must set their location on a map manually.<\/span><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Major Features<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>GPS Support (Mobile Devices) &#8211;<\/strong> The button can use the phone&#8217;s GPS settings to fetch user location.<\/li>\n\n\n\n<li><strong>HTML5 Geolocation Support &#8211; <\/strong>Users are asked to share their location via the browser (HTTPS required), instead of IP-based geolocation which is often less reliable.<\/li>\n\n\n\n<li><strong>Fallback Map Pin Support &#8211; <\/strong>If HTML5 geolocation is denied, users are presented with a map wherein they can drag a pin to the location they wish to search. This map automatically centers on the geolocation of the IP request &#8212; as a result, it is never far-off from the user\u2019s actual location.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Widget Options<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Title<\/strong> <strong>&#8211;<\/strong> The title for the widget.\u00a0<\/li>\n\n\n\n<li><strong>Button Title &#8211; <\/strong>Title of the Near Me button.\u00a0<\/li>\n\n\n\n<li><strong>Button CSS Class (<a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/core-features\/hidden-advanced-settings\/\">A<\/a>) &#8211; <\/strong>CSS class for the Near Me button.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Example Output<\/h2>\n\n\n\n<p>Default output, with browser permissions&#8217; request after clicking the button:&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-ZxdPlsw2f5.png\" alt=\"\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>If geolocation is denied<\/strong> or blocked by the browser or the site is not served over HTTPS <strong>a map will show in a popup<\/strong> for the user to <strong>set their location manually<\/strong>. This map will use the <strong>user&#8217;s IP address to center the map<\/strong> initially.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-t5AGEDbW4t.png\" alt=\"\"\/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The&nbsp; Near Me Button&nbsp;displays&nbsp;a button that when clicked will get the user&#8217;s geolocation and redirect them to your location page where listings will be sorted by distance to the user&#8217;s position. Major Features Widget Options Example Output Default output, with browser permissions&#8217; request after clicking the button:&nbsp; If geolocation is denied or blocked by the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[554,584,619,620],"article\/categories":[213,425],"class_list":["post-783","gd_place","type-gd_place","status-publish","hentry","gd_place_tags-geodirectory-extensions","gd_place_tags-location-manager","gd_place_tags-extension-widgets","gd_place_tags-near-me-button","gd_placecategory-extensions-features","gd_placecategory-location-manager"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=783"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/783\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=783"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=783"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}