Add/change class of UL element of the menu

Public

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

</> CopyGet raw version
php
  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. }

Comments

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?