I’m trying to make a custom WordPress Menu Walker that will wrap top level menu items and their children in a containing tag. In order to to be valid HTML, I think each menu item would need to be its own ul. Is this possible? I’m pretty new to walkers.

I’m doing this so I can use one menu in WordPress to power the panels of a Zurb Foundation tab group. By default, each tab is enclosed in a div.

Maybe something like:

   <div id="id-for-item1">
        <ul>
            <li><a>Top menu item 1<a>
                <ul>
                <li><a>Child menu</a></li>
                </ul>
            </li>
        </ul>
    </div>

    <div id="id-forl-item2">
        <ul>
            <li><a>Top menu item 2<a>
                <ul>
                <li><a>Child menu</a></li>
                </ul>
            </li>
        </ul>
    </div>

Read more here: WordPress Menu Walker: Wrap top menu items in div


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: