Add description to navigational menu
If you want to add a description to a navigational menu in WordPress like this
add the following function as filter:
function description_in_nav_el($item_output, $item, $depth, $args){
return $item_output;
return preg_replace('/([^<]*?)<span>{$item->post_content}</span><", $item_output);
}
add_filter('walker_nav_menu_start_el', 'description_in_nav_el', 10, 4);

Skriv en kommentar