Table of Contents
How to use the country switcher?
GeotargetingWP includes a basic country switcher that will let you users change their default location using a dropdown. The switcher comes in two versions, a sidebar widget and a shortcode, both with the same options.
- Regions: Instead of displaying all countries it's easier to just show a few of them. You can use regions for that.
- Flags: Choose whether you want to show country flags or not.
The shortcode version is
[geot_dropdown regions="" flags="no"]
We don't have a cities dropdown widget but we show you how to build one in here.
How to rename countries?
If you want to change somes names or create custom regions names by changing some countries we do recommend using this code
Another method to rename countries is by "translating" them using poedit or similar software.
How to create a custom widget?
If you are looking to create a cities widget, please find the code in our custom cities dropdown page.
Creating a countries custom solution is much simpler as you only need to save some cookies values with the country two letter ISO code and the plugin will handle the rest automatically. So you could apply the following code to any HTML element such as links, images,etc