Yes, it is typically possible to reâcreate arbitrary markup in WordPress. However the difficulty of the task varies from easy to highly challenging. Sometimes it is easier to bend to markup WordPress gives you, than bend markup to precise state.
For navigation menus there are basically two levels of control over markup:
- As per
wp_nav_menu()
documentation it accepts number of markupârelated arguments. Since menu itself is typically just a HTML list, this can be quite sufficient to customize what that list is wrapped in. - The
walker
argument accepts an object instance to override nativeWalker_Nav_Menu
with. Walker object contains the code that actually iterates over data structures (menu’s in this case) and processes arguments to put things together into HTML output. Customizing it gives full control over process, but the customizing itself is… acquired taste. 🙂 Plenty folks (more so new to WP) don’t like to deal with walkers.