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.

Possible Duplicate:
Adding a class (arrows) to main menu links that have children?

I have two, very basic css dropdowns in my menu. I want to be able to add an arrow next to the dropdowns like shown below.

ss

What I want to do is basicly use wp_nav_menu's 'after' argument, only if the item has a submenu. I'm guessing I need to add a filter but I have no idea how that works. It would be great if someone could point me in the right direction.

Thanks.

share|improve this question
    
you can use CSS to add the arrow, each sum menu gets a class of sub-menu by default –  Bainternet Jul 14 '12 at 21:43
    
Actually I can't. There is no backward selectors in css. I can't target the <a> before the sub-menu, and there is no differentiating class for the ones with a sub-menu in it. And I can't give that image to the sub-menu because of my "overflow:none"s. –  Ege Jul 14 '12 at 23:50
    
via custom walker and css by adding a class to li's that have submenus: wordpress.stackexchange.com/questions/16818/… –  Milo Jul 15 '12 at 0:17
    
@Milo yeah that looks like what I'm after but can you help me a bit here? obviously "if ( $args->has_children ) { // ... }" is where I should add my img tags but I really don't know how to do that. would it work if I wrote $after='<img src="" />' in there? –  Ege Jul 15 '12 at 0:28
add comment

marked as duplicate by toscho Nov 24 '12 at 15:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

I have found my answer in this topic: Adding a class (arrows) to main menu links that have children?

It's pretty genius actually. Copies the original walker function to add your html when the wp is writing the sub-menu uls. Thanks awesome guy.

share|improve this answer
add comment

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