sabah
sabah

Reputation: 11

WordPress theme sub menu does not show up

I am new to WordPress. I am using All Tuts theme

In the custom menu, I added all the categories and subcategories. I arranged them in a proper way up to down left to right. Sub categories are a little right under its parent category. I did save the menu. When I refresh the browser and i put my mouse over a parent category no sub-category showed up.

When I see the editor, the menu does appear in some Theme Function file as I showed below. I just can't understand this kind of code. I need help, please. Thanks.

functions.php

 /*******************************
     MENUS SUPPORT
    ********************************/
    if ( function_exists( 'wp_nav_menu' ) ){
        if (function_exists('add_theme_support')) {
            add_theme_support('nav-menus');
            add_action( 'init', 'register_my_menus' );
            function register_my_menus() {
                register_nav_menus(
                    array(
                        'primary-menu' => __( 'Primary Menu' ),
                        'secondary-menu' => __( 'Secondary Menu' )
                    )
                );
            }
        }
    }

style.css

/* TopMenu */
.ddsmoothmenu {
    position:absolute;
    left:0;
    top:6px;
    border-right:1px solid #2F2F2F;
}

.ddsmoothmenu ul li {
    float:left;
}

.ddsmoothmenu ul li a{
    display:block;
    color:#ccc;
    text-decoration:none;
    border-left:1px solid #2F2F2F;
    height:42px;
    line-height:42px;
    text-transform:uppercase;
    font-size:11px;
    padding:0 12px;
}

.ddsmoothmenu ul li a:hover {
    color:#FFFFFF;
    background:url(images/bk_top_hover.png) 50% 0 no-repeat;
}

header.php

<!-- drop down top menu init -->
<script type="text/javascript">
ddsmoothmenu.init({
    mainmenuid: "topMenu", //menu DIV id
    orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
    classname: 'ddsmoothmenu', //class added to menu's outer DIV
    //customtheme: ["#1c5a80", "#18374a"],
    contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})


<?php if ( function_exists( 'wp_nav_menu' ) ){
                    wp_nav_menu( array( 
                    'theme_location' => 'primary-menu',
                    'container_id' => 'topMenu', 
                    'container_class' => 'ddsmoothmenu',
                    'fallback_cb'=>'primarymenu')
                     );
        }else{
            primarymenu();
        }?>

        <!-- End #topMenu -->

Upvotes: 1

Views: 8059

Answers (2)

Shawn Wernig
Shawn Wernig

Reputation: 1742

Check your template file for a wp_nav_menu call like this:

if ( has_nav_menu( 'primary-menu' ) ) {
                                    ... could be lots of args here...
                                    'menu' => 'primary-menu', 
                                    'depth'           => 1,
                                    'theme_location' => 'primary-menu')); 
}

My suggestion would be to look for the depth argument, and change it to 2, if you want two levels of submenus.

Upvotes: 2

AndyWarren
AndyWarren

Reputation: 2012

Setting the menu

Make sure you have the menu set to be the one that shows like the screenshot above.

Upvotes: 0

Related Questions