add nav menu level class/identifier

  1. benzir

    WordPress getting more popular day by day. Every can use WP for it's flexibility.

    In wordpress should be add Navigation menu level class/identifier. I din't find it WP 3.5.1 and older version. It's very important for style differently for each level. I know it's possible by CSS selector but it's not easy thing. Everyone not expert in CSS. Navigation Menu live class/identifier can be like below:

      <li class="level-1"><a href="">Level 1</a>
        <ul class="level-1">
          <li class="level-2"><a href="">Level 2</a>
            <ul class="level-2">
              <li class="level-3"><a href="">Level 3</a>
              	<ul class="level-3">
                  <li class="level-4"><a href="">Level 4</a>

    Hope WP team will consider this feature.
    Thanks for advance.

    Posted: 5 years ago #
  2. crstauf


    there's nothing expert about the CSS... quite simple:

    ul.menu > li > ul.sub-menu > li > ul.sub-menu > li {
       style for third level li here;

    if you're authoring a theme, you should follow that syntax and not do ul.level-3 li as that style will be applied to a fourth level li, which means you know the > sign anyway.

    Posted: 4 years ago #

RSS feed for this topic


You must log in to post.

  • Rating

    2 Votes
  • Status

    Sorry, not right now