Support » Themes and Templates » Custom Theme not Showing Sub-Menus

  • Hello,

    I have a custom theme and my first level menu items are showing but anything below in the hierarchy is not showing as sub menus. If I switch back to the twenty twelve theme the sub menus show at all levels so I take that as a valid test my menu is setup correctly.

    The theme I am customizing had this line:
    wp_nav_menu( array( 'theme_location' => 'bar', 'depth' => 2 ) )

    well according to codex depth is an optional parm and used to control how many levels are shown. So I set it to zero
    wp_nav_menu( array( 'theme_location' => 'bar', 'depth' => 0 ) )
    and now my sub menus show…sorta. On the screen during mouse over they still do not display but inspecting with developer tools (F12) I see the UL / LI items for the sub menus are now generated.

    Now I am new to php and wordpress but have been developing in c# for over 10 years so I feel comfortable with the changes I have made but clearly I am still missing something.

    I have compared my code to theirs (twenty twelve) and am unable to find the difference.

    Any pointers greatly appreciated

Viewing 7 replies - 1 through 7 (of 7 total)
  • Did you put correct CSS to make the sub-menus show when top menus are hovered? Or are the sub-menus REALLY missing, as in no html is being generated?

    Could you post the url to your site?

    HTML is being generated but unable to find the relevant css section…standby for url.
    In The Beginning >> Squash The Excuses >>

    Ooops forgot I had the theme switched. Try again if you had previously.

    I don’t know how you would do this in css. More like script I would think??? How would you know how many sub categroies there are? Seems more likely that on mouse over you would query for sub categories and show if > 0??

    You can look at the CSS for another theme – like twentytwelve – using a browser tool like Firebug is quite helpful for doing so.

    I have! I’m not smart enough to get it. Twenty Twelve does not to my discovery have a:hover. I can find all sorts of a decorations but no a:hover. Yet somehow twenty twelve shows the sub-menu.

    I do have this in my css
    #navi li ul li {width:12em; padding-bottom:.25em; overflow:hidden;}
    and if I remove overflow then the sub-menu shows *BUT* not on hover but all the time…which is not what I want.

    I know how to inspect the code I think I just don’t know exactly what the nugget is that I am looking for.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom Theme not Showing Sub-Menus’ is closed to new replies.