Best ressource to learn how to my own walker class

[ad_1]

Hello,

I’m currently working on a classic theme, I’m facing difficulties to have the output of menus match the HTML I want.

My structure looks something like this :

<div class=”navbar__nav”>
    <a href=”” class=”nav__item”></a>
    <div class=”nav-dropdown”>
        <a href=”” class=”nav-item”></a>
    </div>
</div>

Which means I likely need to have to write a custom walker but it’s heavily overwhelming, I also have a feeling I might not have written the best HTML to have something easy to walk throughs levels.

Is there a good resource around to help me build such a walker?

Cheers.

[ad_2]
2 Comments
  1. That’s very non-semantic html – is there a reason you need to use that instead of styling the default menu output ?

    Your nav should use <nav> element and <ul>

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer