Adding Custom CSS Classes to WordPress Menu Items

wordpress menu item custom css class

Here’s something that I assumed required a plugin: How can you add one or more CSS classes to a WordPress menu item?

Turns out that’s baked into WordPress by default, but lots of long-term WordPress users (and developers!) don’t know about it because it’s hidden by default.

The linked article has the details. This feature turned out very handy on a recent client project that needed a menu styled per item. The alternatives—fragile nth-child selectors, trying to break into the theme’s “menu walkers,” and so on—are hideous, so again, props to this feature.


Add a Comment

Your email address will not be published. Required fields are marked *