0

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.

4
  • you can use CSS to add the arrow, each sum menu gets a class of sub-menu by default
    – Bainternet
    Jul 14, 2012 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, 2012 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, 2012 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, 2012 at 0:28

1 Answer 1

0

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.

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