How to Add Nav Walker in WordPress?

Adding a nav Walker in WordPress is easy. Firstly, you need to create a new file called wp-content/plugins/navwalker/navwalker.php and add the following code: