Adding css classes to the WordPress menu items

⚠️ Code snippets might not be compatible with the latest version of your theme. Always use a child theme to customize your theme, and test your code on a staging website before migrating to production.

In WordPress, you can easily style your menu by adding css classes to each items and make use of it.

  1. Go to admin > appearance > menu
  2. Click on Screen Options (top right of the screen)
  3. Check the CSS classes options in the “Show advanced menu properties” panel
  4. add your css classes to the element

adding-css-class-to-a-wordpress-menu-item

Then you can easily style your menu element with the custom css option or in your style.css if using a child theme.

See an example with this snippet : How to add a button in the Customizr menu?

Leave a comment

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

19 thoughts on “Adding css classes to the WordPress menu items”