Beschrijving
Features
- Adds
location,latitude, andlongitudemeta + metaboxes to any content type. - Provides an easy to use interface for selecting which content types to apply the above meta values. Note: this allows selection of built in types: page and post as well as any registered custom post types.
- Provides
WP_GeoQueryan extendedWP_Queryclass for doing distance based and geo-aware queries.
Coming Soon!
- Add support for
within radiusoption to WP_GeoQuery - HTML5 geolocation of visitors, with a fallback to
Change Location(stored as COOKIE) - Custom Markers by post type.
- Shortags for:
Get Directionslink (utilizing Google Maps)- Static Map – show one or more posts on a static map
- Dynamic Map – show one or more posts on a dynamic map
- Option to show radius as overlay (for
within radiuscalls)
Installatie
Installation
- Upload the entire
wp-geo-postsfolder to the/wp-content/plugins/directory. - Activate the plugin through the
Pluginsmenu in WordPress.
Setup
- Click the
Settingslink on the plugin management page OR click theWP GeoPostslink from the Settings flyout menu. - Generate a Google Maps API Key and enter it into the provided text input. Note: this is optional and used for Google Maps API calls.
- Select all of the content types that you wish to attach georelated content from the leftmost bank of choices and move them to the rightmost column.
- Submit the Form by clicking
Save Changes.
FAQ
- What are the post meta keys that your metabox adds?
-
For every post type selected on the plugin settings page. That type’s add/edit screens will have an additional metabox automatically added. Metadata that is added to each record:
- Location via
wp_gp_location - Latitude via
wp_gp_latitude - Longitude via
wp_gp_longitude
- Location via
- How do I use WP_GeoQuery? (What is it for?)
-
Make a geo-aware query against the posts table.
WP_GeoQueryaccepts all arguments thatWP_Querytakes.latitudeandlongitudeare optional parameters. If passed,distanceis calculated and returned with each result. In addition to the regular fields, each result returnslatitude,longitude, andlocation.<?php $query = new WP_GeoQuery(array( 'latitude' => '37.5160', // User's Latitude (optional) 'longitude' => '-77.5005', // User's Longitude (optional) 'posts_per_page' => 25, // Any regular options available via WP_Query )); foreach($query->posts as $post) { echo " {$post->post_title}<br />\n"; // returned only if latitude and longitude are passed into WP_GeoQuery echo " {$post->distance}<br />\n"; // Always returned by WP_GeoQuery echo " {$post->location}<br />\n"; echo " {$post->latitude}<br />\n"; echo " {$post->longitude}<br />\n"; echo "<br />\n"; } ?>
Beoordelingen
Bijdragers & ontwikkelaars
“WP GeoPosts” is open source software. De volgende personen hebben bijgedragen aan deze plugin.
BijdragersVertaal “WP GeoPosts” naar jouw taal.
Interesse in de ontwikkeling?
Bekijk de code, haal de SVN repository op, of abonneer je op het ontwikkellog via RSS.
Changelog
1.0
- Initial Release