"menu_id" and "container" problem
-
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>
-
I’m having the same problem. Is this a 3.0.3 bug?
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!
But i have not any Appearance > Menus ? 🙂
<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’); ?>
The topic ‘"menu_id" and "container" problem’ is closed to new replies.