Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Here is my html for the menu:

<div id="main-menu-container">
                <ul id="main-menu">
                <li><a href="#"><span aria-hidden="true" class="icon-home"></span>Home</a></li>
                <li><a href="#"><span aria-hidden="true" class="icon-briefcase"></span>Portfolio</a></li>
                <li><a href="#"><span aria-hidden="true" class="icon-cog"></span>Services</a></li>
                <li><a href="#"><span aria-hidden="true" class="icon-download"></span>Freebies</a></li>      
                <li><a href="#"><span aria-hidden="true" class="icon-user"></span>About</a></li>                 
                </ul>
            </div>

& the wp code:

<?php 
wp_nav_menu( 
array(
 'theme_location' => 'primary',
'container_id' => 'main-menu-container',
'menu_id' => 'main-menu',
) 
); 
?>

As you can see, the problem is I have different span class added to each list item. & I can not use link_before & link_after. I have no idea how to add them in wp_nav_menu.

How can I solve this?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

If you want to add different classes to each menu, you can do that by JS. In JS just add a array, where you should save corresponding menu and it's class. and run a each loop to add classes to menu.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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