0

I'm using FoundationPress as a starter theme and I'm trying to separate the submenu. My theme basically generates menus like this:

<ul>
    <li class=" first-level has-dropdown">
        <ul class="submenu>
            <li class="second-level"><a>link</a></li>
            <li class="second-level"><a>link</a></li>
            <li class="second-level"><a>link</a></li>
        </ul>
    </li>
    <li class="first-level"><a>link</a></li>
    <li class="first-level"><a>link</a></li>
    <li class="first-level"><a>link</a></li>
</ul>

What I'm trying to get is:

<ul>
    <li class=" first-level has-dropdown"></li>
    <li class="first-level"><a>link</a></li>
    <li class="first-level"><a>link</a></li>
    <li class="first-level"><a>link</a></li>
</ul>

<div class="submenu>
    <li class="sub-menus-of-all-levels"><a>link</a></li>
    <li class="sub-menus-of-all-levels"><a>link</a></li>
    <li class="sub-menus-of-all-levels"><a>link</a></li>
</div>

I've had trouble with custom Walkers. How can I solve this?

1 Answer 1

0

Use wp_get_nav_menu_items() and print a menu item from the data of the returned object if it doesn't got menu_item_parent set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.