In recent work where I’ve been using tailwindcss to build my UI, I’ve come up against the challenge of dealing with WordPress’ default menu markup. One possible solution here could be to write a custom walker class but, for something quick and simple, the following code snippet got me where I needed to be with less headache.
This approach is also great for printing a WordPress menu as nothing but <a>
tags which is really useful when dealing with things like footer links. It makes it quick and easy to print the simplest of markup whilst still leveraging WordPress’ menu system to control the menu from the admin.