0

Here is the html structure:

<div class="collapse navbar-collapse main-menu-item justify-content-end" id="navbarSupportedContent">
  <ul class="navbar-nav align-items-center">
    <li class="nav-item"><a class="nav-link" href="/index.php"><i class="ti-home"></i></a></li>
    <li class="nav-item"><a class="nav-link" href="/page2.php">Page 2</a></li>
    <li class="nav-item dropdown">
       <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">News</a>
       <div class="dropdown-menu" aria-labelledby="navbarDropdown">
         <a class="dropdown-item" href="/news/blog.php">Blog</a>
         <a class="dropdown-item" href="/news/press.php">Press</a>
       </div>
    </li>
  </ul>
</div>

I was able to display the menu through wp. But one point still needs to be fixed: the dropdown. Any idea about what I should do?

How to display the li, div and a dropdown classes through the menu?

The dropdown menu appears on the page but should be hidden until I make hover on it, doesn't it?

Should I use Jquery to do this or is it through a wp function? I am a bit lost.

Thanks for your help.

made leod
  • 85
  • 7
  • Duplicate of https://stackoverflow.com/questions/22742630/wp-nav-menu-add-class-on-ul/22742715#22742715 – amarinediary Dec 28 '20 at 17:28
  • Thx but I did all the process to display the menu: adding ul/li/a for the parent class and it works. This is the dropdown that doesn't work and I haven't seen anything in this question that can solve my pb. – made leod Dec 28 '20 at 18:33

0 Answers0