Problem:
How to add Menu Item Descriptions to the Toolset Starter theme?
Solution:
We now have a doc for it:
https://toolset.com/documentation/user-guides/toolset-starter-theme/how-to-add-menu-item-descriptions-to-toolset-starter-theme/
Basically you can enable it in our Toolset Starter theme by following these steps:
1. Please install & activate Toolset Starter Child theme and add the following code in Child theme’s functions.php file (e.g. after line #10):
// Menu Item Description
function nav_menu_description( $item_output, $item, $depth, $args ) {
if ( !empty( $item->description ) ) {
$item_output = str_replace( $args->link_after . '</a>', '<span class="menu-item-description">' . $item->description . '</span>' . $args->link_after . '</a>', $item_output );
}
return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'nav_menu_description', 10, 4 );
2. After that please add CSS for menu item description in Child theme’s style.css file, you can modify the CSS style of the description as required:
.menu-item-description {
display: block !important;
font-size: 13px !important;
font-weight: normal !important;
}
Now you can add descriptions in your WordPress menu items (see doc link below), and it will display Descriptions for each menu item.
Relevant Documentation:
https://toolset.com/documentation/user-guides/toolset-starter-theme/how-to-add-menu-item-descriptions-to-toolset-starter-theme/