DEAL ENDS IN:

HALLOWEEN SALE!

UP TO 40% OFF!

GET IT NOW

Extra Options

Dynamic WordPress Menu Items

In this example, we will demonstrate how to use the [ifso] shortcode alongside existing top-level menu items. Learn how to change menu items and orders based on different factors. Show your customers exactly what they’re looking for every time they visit your site. 

Step 1 – Create an If-So trigger

  1. Navigate to If-So > Add new
  2. Select a condition
  3. Paste the following code in the version’s content field.
<a href="http://exampe.com">Item-name</a>

Don’t forget to replace the link “http://example.com” with your page link.

  1. Publish, and then copy the trigger’s shortcode

Dynamic wordpress menu items create trigger

Step 2 – Add a new item to the menu

  1. Create a new “Custom Link” menu item
  2. Insert “#” as the title
  3. Pate the trigger’s shortcode in the Link Text field
Dynamic Menu item

Troubleshooting

  1. If, after completing the steps above, you see the trigger’s shortcode in the main menu instead of the menu item name on your WordPress dashboard, go to If-So > Settings and check the “Allow shortcodes in titles and menus” option.
  2. If the menu looks broken or the dynamic content is not displayed, try adding ajax=”no” to the trigger’s shortcode, i.e.
[ifso id="1218" ajax="no"]
  • Was this Helpful ?
  • YesNo
Ready to get started?
Try it on your website