2

Im trying to add some html to the nav_menu. Basically I need a button tag inserted after the opening li tag if there are children in the menu. I see that there is a walker class but I have no idea on how to implement this. Any help would be appreciated thanks!!!

<ul class="menu-one">
            <li class="has-children">
           <button class="toggleExpand"><i class="fa fa-arrow-circle-right">    </i></button>
            <a href="about-us.php">About Us</a>
                <ul class="sub-menu">
                    <li><a href="our-team.php">Our Team</a></li>
                    <li><a href="our-principles.php">Our Guiding Principles</a></li>
                </ul>
            </li><li class="has-children">
            <button class="toggleExpand"><i class="fa fa-arrow-circle-right"></i></button>
            <a>Our Fund</a>
                <ul class="sub-menu">
                    <li><a href="fund.php">Fund</a></li>

                 </ul>

            </li>
        </ul>

SOLVED>>>> I was able to add the button to the item_output variable. Basically I grabbed a walker class snippet and added the html to it.

$item_output .= '<button class="toggleExpand"><i class="fa fa-arrow-circle-right"></i></button><a'. $attributes .'>';
0

SOLVED>>>> I was able to add the button to the item_output variable. Basically I grabbed a walker class snippet and added the html to it.

$item_output .= '<button class="toggleExpand"><i class="fa fa-arrow-circle-right"></i></button><a'. $attributes .'>';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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