• Hello,

    I am making a custom menu using the wp_nav_menu code;

    and my issue is that not all the listed items in the menu will have children;

    e.g.

    Parent
    Parent
    – Child
    – Child
    – Child
    Parent
    Parent
    – Child
    – Child

    What i would like to do is have the parents with children to display a small arrow to draw the users attention to action on that parent.

    How would this be achieved?

    Have you guys done something similar?

    Are there any web-resources i could look at in regards to this?

    I have spent the last few hours scouring wordpress and google for answers but to no luck, i am here asking you the wordpress forum.

    Thank you in advance.

Viewing 1 replies (of 1 total)
  • The best solution I’ve found aside from hacking into the plugin’s core files is to use jQuery to add the class:

    My code:
    $(document).ready(function(){
    $(‘#navigation .sub-menu .sub-menu’).parent().addClass(‘has-children’);
    });

    This ensures that only level two and higher menus will get the ‘has-children’ class. Kinda hacky, but works perfectly.

Viewing 1 replies (of 1 total)
  • The topic ‘WP_NAV_MENU -> If has children display a different class’ is closed to new replies.