Skip to content

Instantly share code, notes, and snippets.

@nickdavis
Created February 12, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickdavis/42c49e0678af144a0910 to your computer and use it in GitHub Desktop.
Save nickdavis/42c49e0678af144a0910 to your computer and use it in GitHub Desktop.
Correction of WP Engine GeoIP example code on http://wpengine.com/support/geoip-personalizing-content-based-geography/ (taken from the geoip.php file of the plugin itself)
<?php
function geoip_append_content( $content ) {
$geo = WPEngine\GeoIp::instance();
$content .= "How's the weather in {$geo->city()}, {$geo->region()} {$geo->country()}?<br /><br />";
return $content;
}
add_filter( 'the_content', 'geoip_append_content' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment