Is it theoretically possible to have the following feature?

Each post has a country code. When a visitor comes in, the system will determine the visitor’s country code. Then when the page renders, only the post with that country code is displayed. This need to also affect the widgets/site search etc.

I was asked to evaluate this. I think this would lead to if statements all over the place, in the loop, and I need to modify the widgets too. All in all I think it is doable but difficult and would make the whole code-base unmaintainable. However I want to get some insight in this, since I only have experience with themes, not plugin development.

Also I am not sure how to tag this more appropriately. Any suggestion is welcomed.

UPDATE:
I took a look at the ‘Country Filter’ plugin, it’s nice but does filtering in the content level not the post level. I am also looking at add_filter(request,...) to see if this can be done at the root.

2 Answers
2

Is it theoretically possible to have the following feature?

Yes theoretically there are several Geo location API’s out there, the reliable ones you have to pay for, such as MaxMind.

The latter part sounds strange, if you want the same content, then just use language files.

If for some crazy reason you want to serve up different content per country, it would be quite the undertaking, you most likely would want to create your own API or custom page per country, you dont want a billion if statements.

Leave a Reply

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