Support » Fixing WordPress » Displaying different images for different IPs

  • Jon


    Is it possible to do this within a Post or Page, without making custom templates for each individual one?

    Ideally a way to wrap some code around that links to a maxmind type of database for the IP part.

    Needs to be simple, like me.


Viewing 3 replies - 1 through 3 (of 3 total)
  • Depends how you define simple 🙂

    It can surely be done with some PHP code

    I don’t know of a plugin 🙁 but it sounds like you are looking for a way to serve geo based images.

    I’m assuming you want to display something like a flag for each specific country?
    You can find info about how to do this here
    Real quick code to use in a page template (just one template should dynamically generate the correct flag code for each country), might look like:

    $ip = $_SERVER['REMOTE_ADDR'];
    <img src='<?php echo $ip; ?>' alt='IP Address Lookup' />



    Not sure if page templates will work for me. The image is within the body of the post.

    Will see if I can get php working in Pages and try the second option.

    Not flags, just pictures / photos that are specific to particular locations.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Displaying different images for different IPs’ is closed to new replies.