Add within the output of

Currently i am using:

<?php echo  wp_nav_menu( array( 'menu' => 'main-menu','depth'=> 1,'items_wrap' => '<ul class="navigation_ul">%3$s</ul>' ) ); ?> 

I want to achieve:

<ul class="navigation_ul">
        <li id="menu_1">
        <a href=""  class="active">
            <span class="left_arrow"></span>
            <span class="middle_text">About Us</span>
            <span class="right_arrow"></span>
        </a></li>
        <li id="menu_2">
        <a  href="">
            <span class="left_arrow"></span>
            <span class="middle_text">Downloads</span>
            <span class="right_arrow"></span>
        </a></li>
        <li id="menu_3">
        <a href="">
          <span class="left_arrow"></span>
            <span class="middle_text">For Learning</span>
            <span class="right_arrow"></span>
    </a></li>
        <li id="menu_4">
          <a href="">
            <span class="left_arrow"></span>
            <span class="middle_text">Support</span>
            <span class="right_arrow"></span>
        </a></li>
    </ul>  

But i am not getting it in this way. Please help me out to find out the solution its very urgent.

2 Answers
2

According to the Codex, wp_nav_menu() has a couple parameters to add HTML or entities before and after the generated HTML. The parameters you want is link_before and link_after and to get the effect you’re after looks like this:

'link_before' => '<span class="left_arrow"></span><span class="middle_text">',     
'link_after'  => '</span><span class="right_arrow"></span>'

Leave a Comment