Menu Classes

When building a menu, you may need to customize certain links to be a certain color/style while others remain the base menu style. Using the function below, your links will be given: class="leaf menu-[menu-link-id]".

In template.php file insert this:

* theme_menu_link()
function theme_menu_link(array $variables) {
//add class for li
$variables['element']['#attributes']['class'][] = 'menu-' . $variables['element']['#original_link']['mlid'];
//add class for a
$variables['element']['#localized_options']['attributes']['class'][] = 'menu-' . $variables['element']['#original_link']['mlid'];
return theme_menu_link($variables);