{"id":809,"date":"2025-03-24T14:27:44","date_gmt":"2025-03-24T14:27:44","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/gd-location-switcher\/"},"modified":"2025-04-03T15:24:05","modified_gmt":"2025-04-03T14:24:05","slug":"gd-location-switcher","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/location-manager\/gd-location-switcher\/","title":{"rendered":"GD > Location Switcher"},"content":{"rendered":"<section class=\"alert alert-success dashed\">\n\t 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>.<\/section>\n<section class=\"alert alert-info\">\n\tFor the best results, it is recommended to <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/location-manager\/how-to-add-the-location-switcher-to-menus-and-widgets\/\">add the location switcher to the main menu<\/a>.&nbsp;<\/section>\n<p>\n\t The <strong>Location Switcher <\/strong>is used to <strong>filter listings to a specific location<\/strong> such as a country, region, city <strong>or to order listings by proximity to a user-entered position<\/strong> such as a zipcode or a landmark. The switcher&nbsp;<strong>displays the current location<\/strong> the listings are being filtered to, it <strong>can also be used to clear the current location<\/strong> by hovering over the marker icon to reveal the X to clear.<\/p>\n<h2>Major Features<\/h2>\n<div>\n  The widget adds Location Switcher to the frontend. Location Switcher comes with several useful features, such as:<br \/>\n\t\n<\/div>\n<div>\n<ul>\n<li><strong>Automatic location suggestions based on your location &#8211;<\/strong> Opening the Location Switcher presents a list of nearest cities based on proximity to user&#8217;s location. <\/li>\n<li><strong>AJAX-based location suggestions &#8211;<\/strong> As the user types a location&#8217;s name, the Switcher automatically searches for it and suggests possible results. <\/li>\n<li><strong>Fallback proximity search &#8211;<\/strong> If a search returns zero results from the directory&#8217;s database, Location Manager extension will automatically geocode the search text and provide lists of location suggestions from Google API or OSM API. Users can then do a proximity search for that location.<\/li>\n<li><strong>Saved search history &#8211;<\/strong> Opening the Location Switcher again shows recent search results for quick access.<\/li>\n<li><strong>Near Me<\/strong> <strong>&#8211; <\/strong>Filter and order listings by proximity to your current location.<\/li>\n<li><strong>REST API<\/strong> <strong>&#8211; <\/strong>All queries made by the Location Switcher are via the WordPress REST API. <\/li>\n<\/ul>\n<\/div>\n<h2>Widget Options<\/h2>\n<ul>\n<li><strong>Title<\/strong> <strong>&#8211;<\/strong> The title for the widget. <\/li>\n<\/ul>\n<h2>Example Output<\/h2>\n<p>\n\t Default output, with custom title &#8220;Switch Locations&#8221;:&nbsp;<\/p>\n<p>\n\t<img width=\"659\" height=\"203\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-nYrOJC1WQ8.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-nYrOJC1WQ8.png 659w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-nYrOJC1WQ8-300x92.png 300w\" sizes=\"auto, (max-width: 659px) 100vw, 659px\" \/><\/p>\n<p> <strong><\/strong>Upon clicking, the Location Switcher pops up: <strong><\/strong>&nbsp;<\/p>\n<p>\n\t<img width=\"707\" height=\"276\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-SYWcKDwli9.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-SYWcKDwli9.png 707w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-SYWcKDwli9-300x117.png 300w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>All Widgets come as Widgets, Shortcodes or Blocks. Learn more about our Super Duper Widgets. For the best results, it is recommended to add the location switcher to the main menu.&nbsp; The Location Switcher is used to filter listings to a specific location such as a country, region, city or to order listings by proximity [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[640,645,554,572,584],"article\/categories":[213,425],"class_list":["post-809","gd_place","type-gd_place","status-publish","hentry","gd_place_tags-location-switcher","gd_place_tags-how-to-switch-locations","gd_place_tags-geodirectory-extensions","gd_place_tags-custom-widgets","gd_place_tags-location-manager","gd_placecategory-extensions-features","gd_placecategory-location-manager"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/809","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"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=809"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/809\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=809"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=809"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}