I'm trying to add custom css class to a particular menu, same task mentioned here.
I moved a little further and found this article. So I put following code in template.php:
<?php
function phptemplate_menu_tree($tree) {
if ($tree == menu_tree()) {
$output .= "<ul id=\"foo\" class=\"bar\">";
$output .= $tree;
$output .= "</ul>\n";
return $output;
} else {
return '<ul class="menu">'. $tree .'</ul>';
}
}
?>
but constantly getting 502 error when trying to compare $tree
and menu_tree()
.
Can anyone suggest what am I doing wrong?
UPDATE
I've fixed the initial issue in the question and posted the solution here. Hope it helps.