• Hi

    I would like to add URL parameters to my menu item links. An example being my link to Kitesurfing being

    /product-category/kitesurfing/?mega_menu_item

    rather than

    /product-category/kitesurfing/

    The only way that I can see to achieve this, is when I SET UP the menu to add every link as a “custom link”. i.e You cannot add parameters to Pages, or Product categories, andonce set up they cannot be altered

    Unfortunately, I’m not gong to set up my menu’s from scratch. Is there another way to achieve this????

    regards, Bruce

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author megamenu

    (@megamenu)

    Hi Bruce,

    There’s a filter which you can use, it’s this one:

    https://developer.wordpress.org/reference/hooks/nav_menu_link_attributes/

    (just change ‘nav_menu_link_attributes’ to ‘megamenu_nav_menu_link_attributes’ to target MMM menus).

    There are examples at the bottom of the page, and more on google if you search for the filter name.

    You’ll need to be careful about how you do it, as some of your links already have URL parameters. It might be easier if you can track the clicks from the menu using javascript instead.

    Regards,
    Tom

Viewing 1 replies (of 1 total)

The topic ‘Adding URL parameters to menu links’ is closed to new replies.