I've installed this plugin: <a href="https://tah.wordpress.org/plugins/geoip-detect/" rel="nofollow noreferrer">https://tah.wordpress.org/plugins/geoip-detect/</a>
The plugin seems to work fine when I test "lookup" within the plugin, it returns my geo-information.
However when I try to implement code within one of my wordpress pages it doesn't work.
I'm calling the function from a native woocommerce page where single-products are shown.
But the fucntion returns nothing.
Do I have to include anything more to call the function <a href="https://github.com/yellowtree/wp-geoip-detect/wiki/API-Usage-Examples" rel="nofollow noreferrer">geoip_detect2_get_info_from_current_ip()</a>?
I also tried:
It doesn't return anything either.
I'm doing the editing within godaddy's code editing tool, so I might be missing errors.
The plugin seems to work fine when I test "lookup" within the plugin, it returns my geo-information.
However when I try to implement code within one of my wordpress pages it doesn't work.
Code:
$ip = $_SERVER['REMOTE_ADDR'];
$userInfo = geoip_detect2_get_info_from_current_ip($ip);
echo $userInfo->country->name;
I'm calling the function from a native woocommerce page where single-products are shown.
But the fucntion returns nothing.
Do I have to include anything more to call the function <a href="https://github.com/yellowtree/wp-geoip-detect/wiki/API-Usage-Examples" rel="nofollow noreferrer">geoip_detect2_get_info_from_current_ip()</a>?
I also tried:
Code:
<?php echo do_shortcode("[geoip_detect2 property='country']"); ?>
It doesn't return anything either.
I'm doing the editing within godaddy's code editing tool, so I might be missing errors.