Support » Themes and Templates » Problem with menu

  • Resolved meisam

    (@meisam)


    I’m trying to generate a menu in my template using the following code:

    <?php
    wp_nav_menu(array(
        'theme_location' => 'main-menu',
        'container' => 'nav',
        'container_id' => 'menu',
        'menu_class' => 'navigation',
        'menu_id' => 'nav'
    ));
    ?>

    What I should be ending up with is this:

    <nav id="menu">
        <ul class="navigation" id="nav">
    	<li><a href="http://localhost/sample-page/">Sample Page</a></li>
        </ul>
    </nav>

    Instead I get this:

    <div class="navigation">
        <ul>
            <li class="page_item page-item-2"><a href="http://localhost/sample-page/">Sample Page</a></li>
        </ul>
    </div>

    Am I doing something wrong?

Viewing 1 replies (of 1 total)
  • Please ignore this message I didn’t know that the default generated menu does not follow the arguments passed.

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with menu’ is closed to new replies.