Continue reading Add parent menu class

Add parent menu class

Chip Bennett gave an excellent code snippet in theme reviewers email list. It adds menu-item-parent class to every parent menu item. function my_add_menu_parent_class( $items ) { $parents = array(); foreach ( $items as $item ) { if ( $item->menu_item_parent && $item->menu_item_parent > 0 ) { $parents[] = $item->menu_item_parent; } } foreach ( $items as $item…

Read more Add parent menu class