I have a WP question hoping someone can point me in right direction.
I have a WordPress site that allows users to switch regions â they still see the same pages/menus but the content is different depending on the region they selected.
Now, I would like to display the region at the root of the URL, for example:
http://website.com/au/hello-world/
http://website.com/us/hello-world/
Essentially the first part of the URL will do nothing other than indicate the country they are currently viewing.
I found this question which was similar, but OP ended up using a plugin which I want to avoid.
I see a lot of info about using the query_vars filter to the end of a URL as a way of passing parameters in a clean way, but they all seem to assume you want the param to be at the end of the URL rather than the beginning.
Depending on what you are really after with this, you might try a translation plugin like WPML. You could than “translate” (or in your case just adpat) the content for the specific regions. Seems like the most straight-forward solution to me.