Menu Sub-Category Descriptions

QuestionsCategory: QuestionsMenu Sub-Category Descriptions
Amanda Dunbar asked 11 months ago

I added descriptions to my sub-categories on my menu for SEO purposes. However, when I visit my site and view the sub-categories these paragraph-long descriptions are showing in the actual drop-down menu. It looks like a long mess. How can I keep the descriptions with the sub-categories but disable the descriptions from being shown in the drop-down menu?

1 Answers
Support Team Staff answered 11 months ago

That is because we used that spot as a menu accent spot.  You would need to delete the code in the theme file that displays the description above the menu items.  If you go into the functions file, you will see this and can delete it – Assuming this is for a Kadence theme.  If this is genesis, I’ll have to provide different code.  We can also log on and do this if needed.  Email support@helloyoudesigns.com with the URL and login.
 
function prefix_nav_description( $item_output, $item, $depth, $args ) {
if ( !empty( $item->description ) ) {
$item_output = str_replace( ‘”>’ . $args->link_before . $item->title, ‘”>’ . $args->link_before . ‘<span class=”menu-item-description”>’ . $item->description . ‘</span>’ . $item->title, $item_output );
}
return $item_output;
}
add_filter( ‘walker_nav_menu_start_el’, ‘prefix_nav_description’, 10, 4 );