Alter menu structure when using Superfish menu I am using Superfish menus. I wanted to add a &lt;span&gt; tag before each &lt;a&gt; tag for menu links. I tried the following code:

function mytheme_menu_link($variables) {
    $element = $variables['element'];
    $sub_menu = '';
    if (empty($element['localized_options'])) {
        $element['localized_options'] = array();
    }
    $element['localized_options']['html'] = TRUE; //let l function know that our link title includes html
    $output = l($element['#title'], $element['#href'], $element['#localized_options']);
    return '&lt;li' . drupal_attributes($element['#attributes']) . '&gt;&lt;span&gt;' . $output . "&lt;/span&gt;&lt;/li&gt;\n";
}


but it did not take any effect. Since I am using Superfish menus do I need to write any other code?
The Superfish module bypasses the usual Drupal theming hooks for menus and implements its own. You will need to override the theme_superfish() function in order to change the HTML around those menu items. Copy that function out of superfish.module into your theme's template.php file. Replace the word "theme" in the function name with your theme's machine name, and make your edits.