WordPress.org

Support

Support » How-To and Troubleshooting » How to Add Custom Class to Individual li Items in (wp_nav_menu)

How to Add Custom Class to Individual li Items in (wp_nav_menu)

  • Shahzad

    @shahzadthathal

    Hi there,
    I want to add a css class to the first menu item in wp_nav_menu – as the padding/border for this item needed to be different than the other menu items.
    Any suggestion please! I am already read this function on wordpress.
    http://codex.wordpress.org/Function_Reference/wp_nav_menu
    but nothing do better and not able to apply a css class in li item… I am worried about this…

Viewing 1 replies (of 1 total)
  • Use a tool such as Firebug, Chrome Inspect Element, or IE9+ F12 Developer Tools to inspect the menu item’s HTML output and CSS…you should see a unique style that will be in the form of:

    <li id=menu-item-number …..

    Create a style for this unique id.

Viewing 1 replies (of 1 total)
  • The topic ‘How to Add Custom Class to Individual li Items in (wp_nav_menu)’ is closed to new replies.
Skip to toolbar