Skip to main content
Cheng's user avatar
Cheng's user avatar
Cheng's user avatar
Cheng
  • Member for 7 years, 7 months
  • Last seen more than 4 years ago
comment
How to add class only to top level ul in main menu
Thank!! I try but still doesn't add any class.When I use abc_menu_tree__menu_main_menu()it doesn't add any class.But when I tryabc_menu_tree__main_menu() it add class but affecting all the ul element.
comment
How to add class only to top level ul in main menu
I get the menu name from menu_get_names()function.
comment
How to add class only to top level ul in main menu
Thank!!My menu name is main_menu so write this functions in template.php file am I right.function abc_menu_tree__main_menu(&$variables){ return '<ul class="menu">'.$variables['tree'].'</ul>'; } function abc_menu_tree__menu_top_menu(&$variables){ return '<ul class="menu myclass">'.$variables['tree'].'</ul>'; }
comment
How to add class only to top level ul in main menu
Thank!!How can I override the function theme_menu_tree__menu_top_menu() work for main menu
comment
How to add class only to top level ul in main menu
Thank!!Yes I clear all the cache.My theme name is "abc" so I called the function abc_menu_tree__menu_top_menu(&$variables).Does this function require to override working only for main menu.
comment
How to add class only to top level ul in main menu
Thank!!.I already try "<ul class='myclass'>" in theme_menu_tree__menu_top_menu() but still doesn't work.
Loading…