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;
}

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée.

We use cookies to give you the best online experience. By agreeing you accept the use of cookies in accordance with our cookie policy.

Paramètres de confidentialité sauvegardés !
Privacy Settings

When you visit any web site, it may store or retrieve information on your browser, mostly in the form of cookies. Control your personal Cookie Services here.

These cookies are necessary for the website to function and cannot be switched off in our systems.

In order to use this website we use the following technically required cookies
  • wordpress_test_cookie
  • wordpress_logged_in_
  • wordpress_sec

Decline all Services
Accept all Services