Set up dynamic menus based on the user's location: continent, country, state, city, or timezone.
Use cases
Include a dynamic menu item that points to the visitor’s nearest branch.
Direct users to country-specific help centers or language-specific support articles.
Country-specific pricing or shop – show menu items that link to the appropriate shop domain.
Step-by-step: How to set up location-based menu item
The setup involves two main steps: (1) creating a trigger that defines the locations and their corresponding menu items, and (2) adding that trigger to your WordPress menu.
On your WordPress dashboard, go to If-So → Add New Trigger. Screenshot
In version A, select the geolocation condition and choose the location(s) where the dynamic menu item will appear. Screenshot
In the version A content field, switch the WYSIWYG editor to Code mode and paste the HTML line below, while replacing https://example.com with the page URL you want the menu item to lead to and Item Name with your desired label. Screenshot
<a href="https://example.com">Item Name</a>
On your WordPress dashboard, go to Appearance → Menus.
Click Custom Links to add a new custom menu item, paste the trigger’s shortcode in the Link Text field, and enter # in the URL field.
In the Link Text field, paste the trigger’s shortcode. Screenshot
Screenshots
Create a trigger
Select location(s)
Add the HTML code for the menu item
Add a custom link to your menu
FAQ
How accurate is If-So’s geolocation detection?
If-So’s geolocation detection is highly accurate, using both IP-based databases and the HTML5 Geolocation API. Accuracy depends on the method and user consent. HTML5 detection can pinpoint city-level precision, while IP-based data may vary slightly based on the user’s ISP.
Can users manually select their location if the automatic detection is wrong?
Yes. You can enable the manual user location feature, allowing visitors to override their detected location by selecting a continent, country, state, or city from a dropdown list.
Can I combine multiple geolocation conditions in one trigger?
Yes. You can create multiple versions within the same trigger, each with a different geolocation condition, to target various locations.
Does geolocation detection work with page caching?
Yes. If-So’s geolocation detection works seamlessly with all caching systems by using AJAX loading. Dynamic content is loaded after the cached page is served, ensuring that each visitor sees the correct version based on their location without affecting performance.