Nearby Locations

Display nearby locations based on different parameters using shortcodes and widgets.

The Nearby Locations extension provides an easy solution to display nearby locations anywhere on a page or sidebars using its shortcode and widget. Locations, which are also referred to as "objects", can be posts ( requires the Posts Locator core extension ), BuddyPress members ( requires the Members Locator core extension ), and others, when provided by additional extensions.

Nearby Locations results can get displayed as a list of locations showing the title, distance, directions link, and more. As well you can choose to display the locations on a Google map.

Please note, it was mentioned in the plugin's description and the documentation that the item type "members" is available with the add-on out of the box. However, the item type "members" is not yet available, and at the moment, the only item type available is "posts". I released this add-on before the item "members" was ready due to user requests who have been waiting for the release of the add-on. I will be working on the item type "Members" and, hopefully, it will be available in the next release of the plugin.

How does it work?

Nearby Locations add-on provides a shortcode [gmw_nearby_locations] and a widget that you used on any page and sidebar. The shortcode provides a list of attributes that you can use, and the widget comes with its settings.

There are many features that you can set with the shortcode and the widget; You can select the "item" type ( posts, members, and so on ) that you would like to display, you can also set the radius, the number of results to display, units ( Miles or Kilometers ), show/hide map, and more.

Nearby Locations will search for locations based on the "nearby" point that you choose. There are 4 "nearby" points that you can choose from:

  1. user - show locations nearby the visitor's current position. To do that the plugin will look for the visitor's location (visitors can find their current position using the "Current Location" shortcode/widget ) and search for locations based on that.
  2. item ID - show locations nearby a specific item ID. For example, you can enter a specific Post ID to display other posts near the post that you chose.
  3. item - show locations nearby the displayed item when viewing in a single item page. For example, when viewing a specific post ( in a single post page ) the plugin will display other locations ( posts ) nearby this post.
  4. coordinates - Enter a set of coordinates ( latitude,longitude ) to display locations nearby a specific point on earth.

If the plugin could not find locations nearby the point you set you can choose to display random locations.

What is required?

  • WordPress 4.3 or higher
  • Nearby Locations add-on.
  • GEO my WP plugin version 2.6 or higher.
  • BuddyPress plugin version 2.3 or higher.

Nearby Locations Key Features

Display Nearby Locations

Display location nearby by the visitor's location, a specific item ID, an item being viewd and specific coordinates.

Nearby Locations

Nearby Locations

Nearby Locations on Google Map

Show nearby location on Google Map. You can set the map height, map width, and map type.

Results Template File

Choose between different results template files. Currently, there are 3 template files you can choose from: Default, LightCoral, or LightSeaGreen.

Nearby locations widget

Display nearby locations in any of the sidebars of your theme using the Nearby Locations widget.

Nearby Locations Settings

List of global settings provided by the plugin that you can use with all of the "item" types. Remember, an item can be posts, members and so on.

  • item type - set the locations item type: "posts" for post types or "members" for BuddyPress members.
  • Nearby - choose between user, item, item ID or coordinates.
  • Radius - set the radius to search within from the nearby point
  • Units - search by Miles or Kilometer
  • Results count - Set the number or location that you would like to display
  • Oreder-by - Set the order of the results
  • Order - Choose the ordering direction of the list of results between ascending or descending.
  • Google map - show or hide Google Map
  • Map height - Set the map height in pixels or percentage ( ex. 250px or 100% ).
  • Map width - Set the map width in pixels or percentage ( ex. 250px or 100% ).
  • Map type - choose between ROADMAP, SATELLITE, HYBRID or TERRAIN.
  • Show/hide list of locations - you can hide the list of locations. That is useful in case that you want to only show the map.
  • Group markers - you can group nearby map markers using Markers Clusters.
  • Show distance - show the distance to each location in the list of results.
  • Show image - show the location's image if exists.
  • Address Field - the address fields that you'd like to show for each location in the list of results.
  • Get directions - show "get directions" link for each location in the list of results.
  • Show random locations if no nearby locations were found
  • No Results message - choose the "no results" message that you'd like to show when no nearby locations were found ( when random locations set to false )

Nearby Posts Settings

List of settings you can use when showing posts locations; when the item type is set to "posts".

  • Post types - choose a single or multiple post types
  • Include/exclude taxonomy terms - filter posts by including or excluding specific taxonomy term ID's.
License Agreement
All license options are valid for 1 year from the date of purchase, which during this time you will be eligible for support and updates. All prices are billed yearly until canceled.
For more information, visit our FAQ section or ask a pre-sales question.
Extension Details
Version 2.0.1
Developed by Eyal Fitoussi
Requires WordPress 5.6 or higher
Requires GEO my WP 4.0 or higher
Requirements
WordPress 5.6 or higher
GEO my WP 4.0 or higher
Changelog
  • 2.0.1 - 07/12/24
    • Fix: fix and enable the missing Nearby Locations Widget.
  • 2.0 - 08/26/23
    • This is a major release that is compatible with GEO my WP v4.0. Please read this post before updating the extension on your site.
  • Version 1.4.3 - 4/12/21
    • New: now compatible with the Radius Per Location extension. Use the shortcode attribute radius_per_location=\"1\" to enable the feature.
    • Tweak: change some methods from \"protected\" to \"public\".
    • Tweak: improve search query by checking for the object_type in the JOIN instead of WHERE clause.
    • Filter: \'gmw_disable_query_clause_between\' to disable the BETWEEN query clause.
  • Version 1.4.2 - 11/14/2019
    • Fix: issue when including specific taxonomy terms.
    • Fix: conflict with Elementor plugin when viewing a page with the Nearby Locations shortcode in the Edit page of the admin.
    • Tweak: use require and require_once instead of include_once when including files.
  • Version 1.4.1 - 05/29/2019
    • Fix: Nearby Results are the same across different instances due to an issue with the internal cache of GEO my WP. Fixed by Adding additional arguments to the cache args.
    • Fix: When displaying locations nearby a specific post, exclude that post from the search results.
    • Tweak: pass additional data to the map location array.
    • Tweak: use gmw_get_post_featured_image() instead of get_the_post_thumbnail() function.
    • Tweak: remove the post_title from the orderby clause for better query indexing.
    • Enhancement: pass the image from the list of results into the $post object to be able to use it in the info-window as well. Instead of calling the post image again.
    • Tweak: Move wp_reset_postdate() outside the loop.
  • Version 1.4 - 01/12/2019
    • Requires GEO my WP version 3.2 or higher.
    • improve search query by joining the locations table directly into the WP_Query. That is instead of having additional locations query before and then passing the posts ID via the \'include\' argument of WP_Query.
    • Enable advanced query by default instead of the simple query. Using the WP_Query for better workflow and integration with other plugins.
    • Fix: Update the default values of some variables to prevent error messages.
    • WPCS.
    • Minor bugs fix.
  • Version 1.3.1 - 8/4/2018
    • Compatible and required GEO my WP v3.1 using multiple maps providers.
    • Compatible with the new geocoding system of GEO my WP.
    • Fix: Use include_once instead of include to prevent fatal errors.
    • Fix: custom post types not loading in widget options in admin.
    • Tweak: add dependent marker clusters script.
    • Tweak: Pass default shortcode attributes using a private function instead of a variable.
    • Tweak: update the default map icon URL and size.
    • Enhancement: coding standards.
    • Enhancement: update stylesheet.
    • Enhancement: update code to support PHP 5.4+.
  • Version 1.3 - 4/2/2018
    • This is a major update which is compatible with GEO my WP 3.0+. Please read this post ( http://geomywp.com/geo-my-wp-3-0-beta-7/ ) before updating your plugin.
  • Version 1.2 12/9/2016
    • Fix: map icons not showing.
    • Filter: \'gmw_nbl_item_map_icon\' to modify the item’s map icons.
    • Shortcode attribute: item_map_icon - to set a custom map icon representing the locations on the map.
    • Shortcode attribute: user_map_icon - to set a custom map icon represent the user’s location on the map.
  • Version 1.1 11/11/2016
    • This is a major updated. Version 1.1 was written from scratch. Many features were added and the shortcode changed. The plugin was also renamed to Nearby Locations instead of Nearby Posts. Mainly because the new version will be extended to work with other location components such as BuddyPress members, Groups and more. If you haven\'t used version 1.1 beta until now, please see the new documentation page on how to use the new version of the extension.
  • Version 1.0.2 5/31/2014
    • Fix: Stylesheet does not load when there is no current location for the visitor.
  • Version 1.0.1 5/17/2014
    • Fix: license key cannot be activated
  • 1.0:
    • Initial release
screen