[WP]How to change front page thumbnail URL by detect traffic countries

wkcalvin

Power Member
Joined
Aug 15, 2012
Messages
788
Reaction score
177
I searched a lot, no hints or sample code can completely do this

Any one can help?
 
I don't think this is possible, but then again I could be wrong.
 
I searched a lot, no hints or sample code can completely do this

Any one can help?

Could you explain more or tell me the link of your page so that I could look better at what you want to achieve? I believe it might be possible depending on which thumbnail you want to change. First thing is to detect where did the person came from - it's kind of easy to detect and you need a good updated library of IP's <-> countries mapping. The second thing is custom code for thumbnail change - depending on the situation you can include it in WP's theme files directly or create module with shortcode and use it in posts for example.

One concern though - if you are using advanced caching, this might be the problem (as with everything dynamic on cached pages). So if it is the only one page where you want to achieve this, you could leave that page uncached for example. The second solution is to cache the page PER EACH country, but this means that your country detector must detect country first and then lead to the cached country page. I believe countries can be detected on the server side too, not just on PHP code. The third option is to load image via AJAX call.
 
Back
Top