Menu icon Foundation
Add Reveal Modal to Wordpress Menu

I would like to add a link in my wordpress menu that will trigger a "reveal modal window" - but, I have no idea of how to get the required code

Partners

added to the menu since it seems to strip anything other than just simple css.

Any suggestions are appreciated!

Louise

revealmodal

I would like to add a link in my wordpress menu that will trigger a "reveal modal window" - but, I have no idea of how to get the required code

Partners

added to the menu since it seems to strip anything other than just simple css.

Any suggestions are appreciated!

Louise

Louise D over 5 years ago

<a href="#" data-reveal-id="myModal" data-reveal>

Sorry code was stripped

Stacy Patrick over 5 years ago

Edited because I didn't see that you were replying to your own comment. haha.

I searched a bit and couldn't find a solution so given the time constraints, this might be a bit hacky but it works. Get the class that WP assigns to your link and add this js to it. it sets the data-reveal-id="myModal" and adds the empty data-reveal attribute, the "my-menu-link-name" would be the name it assigns to the parent that contains the link you are trying to modify.

 $('.my-menu-link-name a').attr({
    'data-reveal-id': 'myModal',
    'data-reveal': ''
});