There is this class , which rewrites the standard class names in the Verdpress menu under BEM. It works, everything is ok, but here’s how to set a class-modifier with a number in order for each menu item of the first level, set menu__item_type_1 to the menu__item_type_1 , menu__item_type_1 to the second, etc. They answered the answer, they said the menu itself should be changed. Tell me how to do this?

    1 answer 1

    The English version helped , you just need to create a counter variable (p. 6), then on line 56 you can concatenate the text of the class + counter to the existing classes and increase the counter in line 76 if the menu depth is zero. Modified code here