WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Problem with menu (2 posts)

  1. meisam
    Member
    Posted 1 year ago #

    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?

  2. meisam
    Member
    Posted 1 year ago #

    Please ignore this message I didn't know that the default generated menu does not follow the arguments passed.

Topic Closed

This topic has been closed to new replies.

About this Topic