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.

This code returns my WordPress menu:

 <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'header-menu') ); ?>

What's the easiest (non-JS) way of adding additional class to all .sub-menu ul dropdowns of this menu?

I was thinking about add_filter() for wp_nav_menu but I'm afraid it will point all wp_nav_menus and I want to add these classes only to this particular one. Also, custom walker sounds a bit like an overkill.

What would you recommend?

share|improve this question
1  
What is the purpose of this? Because WP already adds proper CSS classes for if a menu has child and or sub menu that has parent. If this is not what you're looking for and you need something more customized, then I am afraid custom walker is your best bet. –  splashingpixels Aug 31 '13 at 14:53
    
This may help you stackoverflow.com/questions/5034826/… –  Dejo Dekic Aug 31 '13 at 21:45
    
@splashingpixels - OOCSS. –  Wordpressor Oct 23 '13 at 11:08

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.