Hi Don,
There’s no official support (yet), but you can try adding this to your themes functions.php rather than modifying the walker.
function megamenu_item_description( $item_output, $item, $depth, $args ) {
if ( property_exists($item, 'description') && strlen($item->description) ) {
$item_output = str_replace( $args->link_after . '</a>', '<div class="menu-item-description">' . $item->description . '</div>' . $args->link_after . '</a>', $item_output );
}
return $item_output;
}
add_filter( 'megamenu_walker_nav_menu_start_el', 'megamenu_item_description', 10, 4 );
Regards,
Tom
Thanks, Tom. Worked like a charm.
Any plans to roll description support into the plugin in the future?
Hi Don,
Yep, it’s on my todo list.
Regards,
Tom