When I use wp_nav_menu it generates a list with unique ID’s for each li.
This is fine, but if I want to use the menu in multiple places (ie header and footer) it gives validation errors since the id’s are used twice.
Should wp_nav_menu behave this way? If so, is there a way to stop it?
I think this is a major issue with the new wp_nav_menu function, I had the same problem, the way I have resolved it temporarily is to edit the wp-includes/nav-menu-template.php
Obviously this is only a temporary fix as editing the core files is never a good idea, as it will be overwritten everytime you upgrade. I’m hoping it will be fixed in the next version and that it will go back to class names instead of iD’s.
On line 79 of nav-menu-template.php, replace: $output .= $indent . '<li id="menu-item-'. $item->ID . '"' . $value . $class_names .'>';
with: $output .= $indent . '<li' . $value . $class_names .'>';
This will remove the ID from the li item.