Plugin

Address Geocoder WordPress Plugin


A simple WordPress plugin for saving location data with Posts and Pages. Conveniently converts addresses to lat/lng from the Edit screen.

Storing addresses as lat/lng (rather than geocoding each time a user requests a page) decreases load time. This plug-in makes it easy for content managers to generate lat/lng, which is stored with the post as a custom field that can be accessed as part of the loop.

Uses the Google Maps JavaScript API V.3.

Installation and Usage

  1. Get a copy of the plugin from WordPress.org or Github);
  2. Unzip and upload it to your /plugins directory;
  3. Activate the plugin from the Dashboard;
  4. You should now find a metabox labeled “Geocoder” on your Post and Page Edit screens. Enter an address in the address field (this can be an exact address or the name of a famous place — anything Google will understand);
  5. Press the “Geocode Address” button;
  6. The Lat/Lng field will populate with a lat/lng object and a map will appear in the preview box, with a marker on the location.

Access your data in the loop using the functions get_geocode_latlng() and get_geocode_address(), with the post ID passed as a parameter. Such as:

Lat/Lng:
<?php echo get_geocode_latlng($post->ID); ?>
 
Address:
<?php echo get_geocode_address($post->ID); ?>

That’s it!

Issues and Support

If you need a hand or find a bug, please leave a comment here or, preferably, open a ticket on Github. Thanks!

Posted May 11, 2012

Template Part Shortcode and Carolyn Google Analytics WordPress Plugins

I’ve released a couple more plugins to the WordPress plugin directory. They are the result of day-to-day maintenance on a variety of WordPress sites.

Template Part Shortcode

Template parts are reusable snippets of code stored in your theme directory. Normally, they are called by other template files using the get_template_part() function. This plugin creates a shortcode for calling template parts from the body of a post.

Shortcode usage is: [template part=”somepart”].

Template parts must be stored in a “parts” folder within your theme directory.

Get the plugin from the WordPress plugin directory.
Follow on GitHub.

Carolyn Google Analytics

This is a plugin for embedding a Google Analytics (GA) tracking code in your site. It has two features:

  • It stores the GA code as a site setting. This means no modifying theme files, which is especially useful in a Multisite context;
  • The GA code is NOT inserted for logged-in users, meaning you won’t run up your visitor counts as you administer your site;

And that’s it! It works with Google’s “Asynchronous” tracking code, which goes in the page’s head.

Get the plugin from the WordPress plugin directory.
Follow on GitHub.

Posted Nov 11, 2012