• Resolved Narek-T

    (@narek-t)


    Hi. First of all thank you for great plugin, and sorry for my bad english)

    I’m new in php, help me please with snippet which displays different content for different city.
    E.g. I try

    <?php
        $userInfo = geoip_detect2_get_info_from_current_ip();
        if ($userInfo->country->isoCode == '3166-2:RU')
            echo 'This is Saint Petersburg';
     ?>

    I’m not from Saint Petersburg, and I cant try it works or not, but can you tall me, it this right code?
    Thank you.

    https://wordpress.org/plugins/geoip-detect/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Benjamin Pick

    (@benjamin4)

    Look for the names of the attributes in the backend or/and in the Maxmind documentation (see FAQ).

    To get the correct code/id you can use the geoname_id.

    Plugin Author Benjamin Pick

    (@benjamin4)

    Sorry if this sounded too rude …

    I had to think a little longer how I want to treat requests like this. I am used to bug reports in this forum, not “help me implement my requirements”. While I acknowledge that there is a grey area in-between, your request seem to be of the second category. Thing is, I don’t get paid for maintaining this extension and even less for doing client support.

    So if you are not able to implement it yourself, you should look at hiring a coder for it. There are platforms that can help you find people even for such small tasks like this.

    Alternatively, I am willing to help you if you are willing to donate for the charity outlined in the FAQ. But then this is fundraising, not commercial work, so depending on the final scope and how much time I have left it may or may not be done within the next few weeks.

    Thanks for your understanding.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Different content on page for different city’ is closed to new replies.