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.