Created
February 12, 2015 14:26
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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