Extend wp_nav_menu() code

Question

Whats the most simple way to change my wp-menu generated output from

<ul class="primary-menu">
<li class="menu-item">
    <a href="">nav link</a>
    <ul class="sub-menu"></ul>
</li>
</ul>

to

<ul class="primary-menu">
<li class="menu-item">
    <div class="alignme">
        <button></button><a href=""></a><button></button>
    </div>
    <ul class="sub-menu"></ul>
</li>
</ul>

?

I need this kind of “helper div” because I have to align the three elements in a certain way and independent from possible additional content (eg submenu) inside the li.

I am using default wp_nav_menu() and as a first-time theme builder I have no idea where to find the “setup” of the menu. Any idea where I should have a closer look?

0
, , , JonSnow 3 months 0 Answers 54 views 0

Leave an answer