WordPress.org

Ready to get started?Download WordPress

Forums

wp_nav_menu Issue....HELP ME :( (1 post)

  1. kahn02232
    Member
    Posted 6 months ago #

    Hello

    Hope you all doing good.I have custom HTML theme which i was about to convert into WP THEME.While converting i had some issue in menu part where menu have sub menus.I tried and code wp_nav_menu() function button the sub menu doesn't appear well.Below is my simple html code for the menu

    <div class="menu-nav" id="fdw">
    <div class="nav">
    <ul id="MainMenuItem">
      <li><a id="about" href='aboutus.aspx' class="about-link">About Us</a>
        <ul  class="sub_menu-adver">
          <li><a href='aboutus.aspx?url=Executive-Team&id=et'>Executive
            Team</a></li>
        </ul>
      </li>
    </ul>
    </div>

    So i tried to convert this menu into WP menu.Below is my code for that

    <div class="menu-nav" id="fdw">
          <div class="nav">
            <ul id="MainMenuItem">
    
    	<?php
    
    $defaults = array(
    	'theme_location'  => '',
    	'menu'            => 'fdw',
    	'container'       => 'div',
    	'container_class' => '',
    	'container_id'    => 'MainMenuItem',
    	'menu_class'      => 'menu',
    	'menu_id'         => 'MainMenuItem',
    	'echo'            => true,
    	'fallback_cb'     => 'wp_page_menu',
    	'before'          => '',
    	'after'           => '',
    	'link_before'     => '',
    	'link_after'      => '',
    	'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
    	'depth'           => 0,
    	'walker'          => ''
    );
    
    wp_nav_menu( $defaults );*/
    
    ?>
    </ul>
             </div>

    So below is the demo for the website.
    Website

    Where you can see the menu above is the About us menu which is hard coded HTML code and below menus starting from about us to website development.They are not displaying well and the sub menu for project are not showing like above About us menu.

    Thanks for help me advance :)

    Regards

Reply

You must log in to post.

About this Topic