Adding Custom CSS Classes to WordPress Menu Items
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.
Want More Like This?
Join our mailing list and you'll get weekly WordPress tutorials, plus news and tools from around WordPress. You'll also get a free five-day mini-course about the core concepts in WordPress![mc4wp_form]
Add a comment