Dynamic WordPress Menus – 3 min setup

Set up dynamic WordPress menu items that automatically adjust based on a predefined set of conditions.
Geo Menu 1

Use cases

  • Set up a dynamic WordPress menu item that points to the nearest branch.
  • Display a Start here menu item for visitors who haven’t yet visited the Start here page.
  • Disaply a “Special Deal” dynamic menu item for users visiting from a specific country.

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.

  1. Download and activate the If-So Dynamic Content plugin.
  2. On your WordPress dashboard, go to If-SoAdd New Trigger. Screenshot
  3. In version A, select the condition under which the dynamic menu item should appear. Screenshot
  4. 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>
  1. On your WordPress dashboard, go to AppearanceMenus.
  2. 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.
  3. In the Link Text field, paste the trigger’s shortcode. Screenshot

FAQ

Does the dynamic menu item display work with page caching?

Yes. If-So’s dynamic WP menu items work seamlessly with all caching systems by using AJAX loading. The correct menu version is loaded after the cached page is served, ensuring each visitor sees the right menu items based on the set conditions without affecting performance.

Screenshots

add a new trigger 1
Create a trigger
Select location(s)
HTML code
Add the link HTML code
Custom link
Add the trigger as a custom link in your menu

Didn’t find what you need?

Christmas Sale!
Up to 40% Off