Simple locator is ideal for developers who are looking for a way to implement location search for any post type within WordPress. Simple locator is different in that it allows the selection of any existing custom fields for use as the geocoded data sources. If there are no existing data sources, the plugin ships with a "location" post type with fields ready to go.
Best suited for WordPress developers looking for a customizable way of adding location search.
Learn more at locatewp.com and download from the WordPress Plugin Repository.
Simple Locator requires WordPress version 3.8+ and PHP version 5.4+. Simple Locator version 1.1.5 (no longer maintained) is compatible with PHP version 5.3.2+.
- Upload simple-locator to the wp-content/plugins/ directory
- Activate the plugin through the Plugins menu in WordPress
- Click on the Locations Menu item to begin adding locations.
- To change the post type, geocoded fields, or map styles, visit Settings > Simple Locator
- cd into the wp-content/plugins directory
- Clone the project:
git clone https://github.com/kylephillips/wp-simple-locator.git simple-locator
cd
into thesimple-locator
directory and runcomposer install
to download & install the plugin dependencies. More on composer- Activate the plugin through the Plugins menu in WordPress
To display the locator, include the shortcode [wp_simple_locator]
. See available options and customization on the plugin website
Full form output and query customization is available through the plugin filters. See the plugin website for full examples and documentation. By using the various filters, it is possible to add a fully-customized search form, using any number of custom criteria.
simple_locator_form_filter($output, $distances, $taxonomies, $widget)
Customize the form HTML output. Custom fields may be added to the form, and accessed via the post field filter and query filters.
simple_locator_result($output, $result, $count)
Customize the HTML output of each result in the list view.
simple_locator_infowindow($infowindow, $result)
Customize the HTML output for the Google Maps Info Window for each result.
simple_locator_post_fields()
Include custom fields in the form POST data, for use in custom query filters. Fields should be passed as an array of field names that correspond to the custom input names added in the simple_locator_form_filter
filter.
simple_locator_sql_select($sql)
Customize the SELECT statement in the search query.
simple_locator_sql_join($sql)
Customize JOINS in the search query.
simple_locator_sql_where($sql)
Customize the WHERE clauses in the search query.