Pregunta

My client has a wordpress site. However for people visiting the site from a UK IP address he wants different information. Some of the differences include code changes, other differences include a change in the nav menu, and change in content.

Im thinking of duplicating the site where a simple redirect occurs based on UK IP address. However the issue with this is having two sites to maintain.

Are there any other relatively simple ways of setting this up? I would prefer not use wordpress multisites as I dont think that will cater for code changes.

Thank you

¿Fue útil?

Solución

Geoposty wordpress plugin determines your visitor's location from their ip address, then displays dynamic content that is spescific to their area.

Many more plugins are also used for geo targeting like Geo Redirect, WordPress Geo IP Redirect, Source Redirect Site, WP Geocode Marketing Intelligence these all are free, There's a premium plugin also for geo targeting named Flytonic Geo Target

But!!!

If I'm a French user, but my IP shows I'm in Germany while I use an English browser. The most convenient would be English for me, because that is my choice.

There's a PHP superglobal variable, called $_SERVER. It stores information about the server running the page and about the client who requested the page. One string of this array's parameters is called HTTP_ACCEPT_LANGUAGE, sent by the browser, which in this case will be en. It can be accessed from PHP as: $_SERVER['HTTP_ACCEPT_LANGUAGE'].

This can be used to get the specified content for example with a custom field which contains values what this string can be.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top