WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] "menu_id" and "container" problem (5 posts)

  1. insanoff
    Member
    Posted 3 years ago #

    I am using the <?php wp_nav_menu( array('container' => 'none', 'menu_id' => 'mother_navi', 'theme_location' => 'primary' ) ); ?> and here is the result:

    <div class="menu">
      <ul>
        <li class="page_item page-item-15"><a href="http://localhost/avantajbul/?page_id=15" title="Advertise">Advertise</a></li>
        <li class="page_item page-item-17"><a href="http://localhost/avantajbul/?page_id=17" title="Write">Write</a></li>
        <li class="page_item page-item-2"><a href="http://localhost/avantajbul/?page_id=2" title="About">About</a></li>
        <li class="page_item page-item-20"><a href="http://localhost/avantajbul/?page_id=20" title="Terms">Terms</a></li>
      </ul>
    </div>

    But i want only this:

    <ul id="mother_navi">
      <li class="page_item page-item-15"><a href="http://localhost/avantajbul/?page_id=15" title="Advertise">Advertise</a></li>
      <li class="page_item page-item-17"><a href="http://localhost/avantajbul/?page_id=17" title="Write">Write</a></li>
      <li class="page_item page-item-2"><a href="http://localhost/avantajbul/?page_id=2" title="About">About</a></li>
      <li class="page_item page-item-20"><a href="http://localhost/avantajbul/?page_id=20" title="Terms">Terms</a></li>
    </ul>
  2. petethechop
    Member
    Posted 3 years ago #

    I'm having the same problem. Is this a 3.0.3 bug?

  3. petethechop
    Member
    Posted 3 years ago #

    OK, I just figured it out.

    First, you need to create the Menu using the Appearance > Menus editor. Whatever you name it, let's say "Mother Navigation," needs to be registered in the functions.php file, like so:

    function register_custom_menu() {
    register_nav_menu('mother_navi', __('Mother Navigation'));
    }

    I hope that helps!

  4. insanoff
    Member
    Posted 3 years ago #

    But i have not any Appearance > Menus ? :)

  5. insanoff
    Member
    Posted 3 years ago #

    <ul id="mother_navi">
    <li class="page_item<?php if(is_home()){ ?> current_page_item<?php } ?>">" title="Home">Home
    <?php wp_list_pages('title_li=&depth=1'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic