Why are classes different for custom menu? (3 posts)

  1. darrcass
    Posted 3 years ago #

    The default wp_nav_menu(), using no custom menu, does this:
    <ul><li><a>...</a><ul class="children"><li><a>...</a></li></ul></li></ul>

    ...but a custom menu uses a different class for the nested list...
    <ul><li><a>...</a><ul class="sub-menu"><li><a>...</a></li></ul></li></ul>

    Why? Is there some "gotcha" reason involved? It doesn't make any sense to me.

  2. WPyogi
    Forum Moderator
    Posted 3 years ago #

    If someone used a secondary custom menu on a site, having the same class would potentially be quite problematic.

  3. darrcass
    Posted 3 years ago #

    Not if the secondary menu has a different id.

Topic Closed

This topic has been closed to new replies.

About this Topic