I am using nginx + fastcgi + wordpress. I want to display the right content based on client’s real IP city. I used wordpress shortcode to fetch the city name for an ip. The problem is due to the cache. All users will see the same city name until the cached content expires.
I googled and found following post:
But I am not sure which file should we edit to add the following text replacement code:
jQuery('body *').replaceText( '[city]', getenv('GEOIP_CITY') );
Read more here: How to use jQuery replaceText on wordpress home page?