Add/change class of UL element of the menu


In template.php file add the following snippet (In our case, we're adding 'inline' class to ul element of the menu):

Get raw version
  1. /**
  2.  * Override theme_menu_tree().
  3.  */
  4. function YOURTHEME_NAME_menu_tree__YOUR_MENU_NAME($variables) {
  5. return '<ul class="menu inline">' . $variables['tree'] . '</ul>';
  6. }


deelite's picture

Is there a version of this snippet for Drupal 6?

Binu Varghese's picture

Thanks! it worked!!

Anonymous's picture

This works for me. How can I get it to only add the class to the main ul wrapper?