How to create Loop code for Menu using WordPress?

You have to add a custom walker to the wp_get_nav_menu. You can try a loop through wp_get_nav_menu_items as well