This is an interesting problem, its related to the above (overwriting functions).
I tried to overwrite the thematic function thematic_add_menuclass.Here's the original:
// Add ID and CLASS attributes to the first ul occurence in wp_page_menu
function thematic_add_menuclass($ulclass) {
return preg_replace('/< ul >/', '<ul id="nav" class="sf-menu">', $ulclass, 1);
}
add_filter('wp_page_menu','thematic_add_menuclass');
To overwrite it, I did the following in my child theme's functions.php file:
function my_add_menuclass($ulclass) {
return preg_replace('/< ul >/', '<ul id="fubar" class="sf-menu">', $ulclass, 1);
}
remove_filter('wp_page_menu','thematic_add_menuclass');
add_filter('wp_page_menu','my_add_menuclass');
}
All my replacement function should do is add the same additional attributes to the first ul as the original function, but to add 'fubar' instead of 'nav'.
The page menu to be outputted is 2 levels deep, i.e. there is a ul with the primary page links, and a nested ul with one secondary page, something like:
<div class="menu">
< ul >
< li > < a.. > About < /li >
< li > Disciplines
< ul >
< li > < a.. > Judo < /li >
< /ul >
< /li >
< /ul >
< /div >
Leaving things as they are (i.e. using the original function), I get this output:
<div class="menu">
< ul id="nav" class="sf-menu">
< li > < a.. > About < /li >
< li > Disciplines
< ul >
< li > < a.. > Judo < /li >
< /ul >
< /li >
< /ul >
< /div >
But when I add my function override, I get this (it seems that both the old and new functions are called, the new one first for the main ul, and the old one for the inner ul):
<div class="menu">
< ul id="fubar" class="sf-menu" >
< li > < a.. > About < /li >
< li > Disciplines
< ul id="nav" class="sf-menu" >
< li > < a.. > Judo < /li >
< /ul >
< /li >
< /ul >
< /div >
Anyone have any ideas what's going on? I could do the fix I want by editing the function in the thematic code, but that would defeat the purpose of having a child theme.
Eddie
PS - apologies for the formatting, I had to change all of my angle brackets to unicode and it looks very odd!