We'll create fresh WordPress site with Simple Locator installed. You have 20 minutes to test the plugin after that site we'll be deleted.
Why use Simple Locator?
Simple locator is ideal for developers who are looking for a way to implement location search for any post type. Simple locator is different in that it allows the selection of any existing custom fields for use as the geocoded data sources.
Don’t have an existing post type with geocoded latitude and longitude fields? Simple Locator includes a default “Locations” post type with fields for latitutde, longitude, address, phone number, website, & more. This post type’s name and labels are configurable through the plugin settings.
Simple Locator also offers developer-friendly options for adding custom Google Maps styling. Select from an existing list, leave the default styles, or add your own JSON styles.
Using Simple Locator
For more information visit locatewp.com.
Important: Simple Locator requires WordPress version 3.8 or higher, and PHP version 5.4 or higher.
The shortcode to display the form and results is [simple_locator]. There are several options available for customizing the form and results:
Visit locate.wp for more detailed information.
Options include the title, distance options, and the map height. To use the widget outside of a predefined sidebar area, use the following function in your template, as outlined in the WordPress documentation. The widget name is SimpleLocator\Widgets\Form (must include namespaces).
To enable Google Places autocomplete in the search form, visit Settings > Simple Locator > General, and select the “Enable Autocomplete in Search” option. Your form will now include an autocomplete dropdown populated by the Google Places API.
By default, a map of the location is added to the content on singular views. To remove this feature, update the setting under Simple Locator > General Settings.
A number of JavaScript functions are provided to extend and customize the map results. Visit locatewp.com for a list and usage details.
For a complete description of available filters and example usage, see the plugin website.
simple_locator_form($output, $distances, $taxonomies, $widget)
– Customize the search form HTMLsimple_locator_result($output, $result, $count)
– Customize the result output within the result listsimple_locator_infowindow($infowindow, $result, $count)
– Customize the display of results within the Google Maps infowindowsimple_locator_post_fields()
– Add additional fields to the search parameters (field names for $_POST data)simple_locator_sql_select($sql)
– Add additional fields to the SELECT sql query during searchsimple_locator_sql_join($sql)
– Join additional fields in the sql query during searchsimple_locator_sql_where($sql)
– Add additional WHERE parameters to the sql query during searchsimple_locator_form_in_results($display_form)
– Whether to show the form in results (bool)simple_locator_all_locations_text($text)
– Filter the text output of “All Locations”simple_locator_map_pin_single($html)
– Filter the single view map pinsimple_locator_js_map_options($options)
– Filter the Javascript options passed to Google Maps for map displaysimple_locator_autocomplete_js_options($options)
– Filter the Javascript options passed to the Google Maps Autocomplete APIsimple_locator_form_taxonomies($taxonomies)
– Filter the taxonomies displayed in the search form