You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.
On a new project I started out doing some prototyping on a static html page. On that static page I was able to get the desktop menu to behave perfectly: just a top-bar with a menu on the right, each menu item had a submenu, and I added some Motion UI to it so that the submenus hinged up and down.
Now I'm trying to get it to work in WordPress, and I'm having a hard time. I have a feeling I need to extend Walker_Nav_Menu, but I've never dealt with a walker before, so I'm a bit in over my head right now!
I've done some reading on WP's walkers, but still pretty confused.
Here's what I tried to do: Basically I just copied one of the extensions in menu-walkers.php and created a new test walker. My test walker is at the bottom:
However, when I take a look at my menu with Chrome dev tools, the data attributes and id that I tried to add via the walker aren't showing up. What did I do wrong?
Also, as far as I know, in order to get the Motion UI to work for each menu/submenu, they need unique IDs. Eg, #submenu-1 for first menu item, #submenu-2 for the second, etc. Using the walker, what's a good way to do that?
Thanks for any help in advance...!
Steven
The text was updated successfully, but these errors were encountered:
Hi folks,
On a new project I started out doing some prototyping on a static html page. On that static page I was able to get the desktop menu to behave perfectly: just a top-bar with a menu on the right, each menu item had a submenu, and I added some Motion UI to it so that the submenus hinged up and down.
Now I'm trying to get it to work in WordPress, and I'm having a hard time. I have a feeling I need to extend
Walker_Nav_Menu
, but I've never dealt with a walker before, so I'm a bit in over my head right now!I've done some reading on WP's walkers, but still pretty confused.
Here's what I tried to do: Basically I just copied one of the extensions in
menu-walkers.php
and created a new test walker. My test walker is at the bottom:However, when I take a look at my menu with Chrome dev tools, the data attributes and id that I tried to add via the walker aren't showing up. What did I do wrong?
Also, as far as I know, in order to get the Motion UI to work for each menu/submenu, they need unique IDs. Eg,
#submenu-1
for first menu item,#submenu-2
for the second, etc. Using the walker, what's a good way to do that?Thanks for any help in advance...!
Steven
The text was updated successfully, but these errors were encountered: