Replace WordPress-menu with my menu
-
I have a created a theme, and here is the menu in the html-file:
<div class="nav-collapse collapse" style="height: 0px;"> <ul class="nav pull-left"> <li class="active"><a href="#">Home</a></li> <li><a href="#">About the company</a></li> <li><a href="#">About the store</a></li> <li><a href="#">Shoes</a></li> <li><a href="#">Yogurt</a></li> <li><a href="#">Contact us</a></li> </ul> </div>
I replace this with:
<div class="nav-collapse collapse" style="height: 0px;"> <ul class="nav pull-left"> <?php wp_nav_menu( array('menu' => 'Main', 'container' => 'nav' )); ?> </ul> </div>
..and WordPress write:
<div class="nav-collapse collapse" style="height: 0px;"> <ul class="nav pull-left"> <div class="menu"><ul><li class="page_item page-item-2"><a href="https://www.webbsmeden.com/about/">About</a></li></ul></div> <!--<li class="active"><a href="#">Home</a></li> <li><a href="#">About the company</a></li> <li><a href="#">About the store</a></li> <li><a href="#">Shoes</a></li> <li><a href="#">Yogurt</a></li> <li><a href="#">Contact us</a></li>--> </ul> </div>
As you can see, WordPress add <div class=”menu”>, ul and a li class. This I don’t want. I have looked a lot into wp nav menu in the codex and tried a lot of things, but can’t manage it to work.
- The topic ‘Replace WordPress-menu with my menu’ is closed to new replies.