Add attributes to wrapper html generated by wp_nav_menu

Modifying the wrapper for the wp_nav_menu() is customizable with the items_wrap parameter. https://developer.wordpress.org/reference/functions/wp_nav_menu/ The documentation states that the default wrapper is a <ul> element with an ID an CLASS attribute. This can be modified as you wish by modifying the markup passed to the sprintf() function used by wp_nav_menu(). The value for items_wrap is the … Read more

get_nva_menu_locations returns only filled ones

The real job of above functions aren’t to get locations but to get locations and the menu they have inside. Something like array($location1 => $menu_id1,);. So these functions don’t list empty locations. If you want to get all filled and empty locations you might want to add the following to your function.php file: //// here … Read more