For the menu in 3.0 version of WordPress you must place the following code:
function add_markup_pages($output) {
$output= preg_replace('/menu-item/', 'first-menu-item menu-item', $output, 1);
$output=substr_replace($output, "last-menu-item menu-item", strripos($output, "menu-item"), strlen("menu-item"));
return $output;
}
add_filter('wp_nav_menu', 'add_markup_pages');
It gives “first-menu-item” under id while it gives “last-menu-item” under class. If anyone can correct this it would be great. Not a big deal though. As long as it works ??