First +1 for using blueprint css :)
Second: Yes, separators are just presentational and shouldn't be part of the menu (screenreader using people would be confused). So here you get a simple function to add separator-css-classes or any other additional classes whereever you need them. Just modify the three vars to your needs.
And now here's the function that let you exactly target a single nav menu item in a specific location within a specific menu. You just have to modify the first three vars $menu_location
, $menu_name
, & $menu_item
to your needs.
function wpse15844_nav_top_classes( $classes, $item )
{
// EDIT HERE: This is the nav menu location slug
$menu_location = 'top';
// EDIT HERE: This is the nav menu name you entered in the admin-UI > Appearance > Menus (Add menu)
$menu_name = 'Topnav';
// Abort if we're not with the named menu
if ( is_nav_menu( $menu_name ) !== true )
return;
if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_location ] ) )
{
$locations = get_nav_menu_locations();
$menu = wp_get_nav_menu_object( $locations[ $menu_location ] );
$menu_items = wp_get_nav_menu_items( $menu->term_id );
}
// Abort if we're not in the specified location
else
return;
// EDIT HERE: Enter the nr. of the menu item. Currently we're adding to the last one.
$menu_item = intval( count( $menu_items ) );
if ( $item->menu_order == $menu_item )
{
$classes[] = 'span-10 clearfix';
}
else
{
$classes[] = 'span-10 clearfix separator';
}
return $classes;
}
add_filter( 'nav_menu_css_class', 'wpse15844_nav_top_classes', 10, 2 );
You can then style your separator as you need it from inside your css file.