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.

I'm using Donald Harvey's solution with Custom Walker_Nav_Menu to show an arrow where submenu items belongs. It worked for me in a project where I had a left sidebar vertical menu. But when I'm utilizing the code for a top nav menu with a drop down menu for the subs, and I incorporated Font Awesome icon as an arrow, the problem is:

Home | Level 0 ▼ | Services | Works
     +-----------+
     | Level 1   |-----------+---------+
     | Level 1 ▼ | Level 2 ▼ | Level 3 |
     +-----------| Level 2   |---------+
                 +-----------+

You can understand that, from Level 1 to all the children, the arrow should not point down, but should point right () as my submenus are not opening from below, but on the right.

So how can I modify this to show the desired arrows in place?

if ( !empty( $children_elements[$element->$id_field] ) ) { 
     $element->classes[] = 'arrow';
     $element->title .= '<span class="arrow fa fa-caret-down"></span>';
}
share|improve this question

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.