• Basically I have created a custom wordpress theme and have added a custom menu so that I can display the logo in the middle of the navigation menu. I have 2 menus one on the left of the logo and one on the right. When I add the menu items and want them to act as drop down items it does not display them as such and instead displays the items next to the parent page as though they are not a sub menu item.
    I am guessing that this is due to my custom menu code but am very unsure how I would change it to show them as sub menus. This site is currently only on my localhost and not live.
    This is the code I have in my header.php file:

    <div class="navigation">
    
    <ul>
        <?php
            $menu_left = wp_get_nav_menu_items( 3 );
            $menu_right = wp_get_nav_menu_items( 4 );
    
            foreach ( (array) $menu_left as $key => $menu_item ) {
                echo "
    <li><a href="">url . "\">" . $menu_item->title . "</a></li>
    " ;
    
            }
    
        ?>
        <?php
            echo "
    <li><img src='logo1.png'/></li>
    ";
        ?>
        <?php
            foreach ( (array) $menu_right as $key => $menu_item ) {
                echo "
    <li><a href="">url . "\">" . $menu_item->title . "</a></li>
    " ;
        }
        ?>
    </ul>
    </div><!-- .navigation -->

    and this is the code in my functions file:

    register_nav_menus( array(
    'nav_left' => 'Left Nav Menu',
    'nav_right' => 'Right Nav Menu',
     ) );

    Any help is much appreciated and thank you in advance I have been struggling on this for quite a long time now.

  • The topic ‘Custom Theme and menu – drop down not working correctly’ is closed to new replies.