I was trying to do the same to develop my theme and stumble this article and really help me to learn about this. Needless to say "Thank You All" for sharing your knowledge with others that may have this problem(like me...).
I did a little modification to it(again). what I did was to add a class for the title to be able to style it with css. with this method you can style both the title and the description, using different classes in the css. Other thing I did was to include both, the title and the description in the same link so both of them are clickable not just the title (they are now in the same block LI with different classes)... here is the code
just one comment before the code, you can change name of the class of the title or the name of the class sub if those cause a conflict in your page...
<?php
class My_Walker extends Walker_Nav_Menu
{
function start_el(&$output, $item, $depth, $args) {
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
$class_names = ' class="' . esc_attr( $class_names ) . '"';
$output .= $indent . '<li id="menu-item-'. $item->ID . '"' . $value . $class_names .'>';
$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
$item_output = $args->before;
$item_output .= '<a'. $attributes .'>';
$item_output .= '<span class="title">' . $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . '</span>' . $args->link_after;
$item_output .= '<span class="sub">' . $item->attr_title. '</span></a>'; /* This is where I changed things. */
$item_output .= $args->after;
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
}
}
?>
By the way this is my first contribution to wordpress.org and I am still learning, I'm a beginner, and still developing my first theme.
I hope this help you people
PD. my English it's not that good because it's not my first language so, please forgive the inconsistencies in the text-form / spelling etc.