Been reading about this topic a lot but don’t seem to find a satisfying answer.
Issue: I want to style each of my menu items differently.
Solution: give each li it’s own class: let’s say:li-1 li-2 etc.
Tackles: I don’t care about the menu order, the default start should be 1 and adds +1 to following one.
In css I would have used the ‘nth-child(1)’ but that’s not supported by all browsers.
A common solution I found, was the backend approach which allows you to add a custom class to a menu item. Con: shift in menu order messes things up.
I thought of the add_filter: “nav_menu_css_class” … but that only targets óne class. I just want to get an array of all the li’s in my menu and do a simple ‘for each’ …. but how??