Hi Tom,
Sorry about the confusion. Your recommendation worked and we’re able to add the ID’s to the actual anchor tag. Thank you!
Hi Tom,
We’ve tried this on our staging site and weren’t able to get any id’s to appear on the <a> itself.
function add_id_to_menu_items( $atts, $item, $args ) {
// Set the ID attribute to the value of the menu item’s title. if(!empty($item->title))
$atts[‘id’] = $item->title;
return $atts;
}
add_filter( ‘nav_menu_link_attributes’, ‘add_id_to_menu_items’, 10, 3 );