• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

wp_nav_menu adding a class to a menu item

March 6, 2012 by Webhead

Problem

I have a menu which uses wp_nav_menu and I need to add a class to the first item because my menu items have a left border on them.  I don’t want the first item to show a border.

 

Solution

WordPress is just so easy to use.  This may not have been in previous versions, but as of 3.3.1 at least there is a way to add a class to each menu item through the interface.  Go to Appearnace->Menus.  At the top, click on Screen Options and check “CSS Classes”.  Now you can expand a menu item and add a class in there.

 

Thanks to: http://www.sandboxdev.com/2010/09/23/howto-add-custom-classes-to-individual-items-wp_nav_menu/

Filed Under: Coding Tagged With: wordpress

Primary Sidebar

Topics

apache apple block editor chrome cms css debug eCommerce embed firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery linux localization mac os x ms sql mysql open source optimize php php 5.3 responsive rest api seo svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools