How to use jQuery replaceText on wordpress home page?

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:

http://community.rtcamp.com/t/prevent-fastcgi-cache-from-caching-specific-functions-or-wp-shortcodes/2506/4

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?

Leave a Reply

Your email address will not be published. Required fields are marked *