Flatsome Show Description in Menu Item

WordPress

If you want to show the description of a menu item in flatsome you need to add the following code into your functions.php

add_filter('walker_nav_menu_start_el', 'we_show_description_in_menu', 10, 4);
function we_show_description_in_menu($item_output, $item, $depth, $args ) {

if(!isset($item->description) || empty($item->description)) {
return $item_output;
}

$item_output .= '<p class="menu-item-description">' . $item->description . '</p>';

return $item_output;
}

Leave a Reply

Your email address will not be published. Required fields are marked *