How to specify or extend the CSS-class of a menu item?
-
16-10-2019 - |
Question
is there a way to allow admin users to add classes to individual menu items in the back end? we have done some individual javascripting and CSS using the title tag, but that is not flexible as it is visible to the end user, so the method is not suited effects needed to be applied to multiple items.
Solution
This is natively supported by WordPress. In the menus page, click "Screen Options" (in the upper right corner):
Then check "CSS Classes":
You will now have a "CSS Classes" Option for each menu item:
Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange