Trouble with hover menu
-
Hello,
I’m trying to build a hover menu for my theme like the one that is included in the Twentyten theme. I like the second level of pages to hover.
As I’ve used the twentyten theme as the basis for my theme, I suspected this would be easy. Unfortunately, the second level of pages won’t hover and are always displayed.
If I look at the code that is outputted when I switch to the twentyten theme it is this:
<div class="menu-header">
<ul id="menu-main" class="menu">
<li id="menu-item-54" class="menu-item menu-item-type-taxonomy current-menu-item current-category-ancestor menu-item-54">Nieuwsbrieven
<li id="menu-item-49" class="menu-item menu-item-type-custom menu-item-49">Organisatie
<ul class="sub-menu">
<li id="menu-item-45" class="menu-item menu-item-type-post_type menu-item-45">Bedrijfsprofiel
<li id="menu-item-44" class="menu-item menu-item-type-post_type menu-item-44">Partners
<li id="menu-item-43" class="menu-item menu-item-type-post_type menu-item-43">Medewerkers
<li id="menu-item-42" class="menu-item menu-item-type-post_type menu-item-42">Werken bij Akro
<li id="menu-item-41" class="menu-item menu-item-type-post_type menu-item-41">Contractvoorwaarden<li id="menu-item-21" class="menu-item menu-item-type-post_type menu-item-21">Werkvelden
</div>
However, when I use my own theme, the template tag (<?php wp_nav_menu( array( ‘container_class’ => ‘menu’, ‘theme_location’ => ‘primary’ ) ); ?>) will produce this:
<div class="menu-header">
<ul id="menu-main" class="menu">
<li id="menu-item-54" class="first-menu-item menu-item menu-item-type-taxonomy current-menu-item current-category-ancestor menu-item-54">Nieuwsbrieven
<li id="menu-item-49" class="menu-item menu-item-type-custom menu-item-49">Organisatie
<ul class="sub-menu">
<li id="menu-item-45" class="menu-item menu-item-type-post_type menu-item-45">Bedrijfsprofiel
<li id="menu-item-44" class="menu-item menu-item-type-post_type menu-item-44">Partners
<li id="menu-item-43" class="menu-item menu-item-type-post_type menu-item-43">Medewerkers
<li id="menu-item-42" class="menu-item menu-item-type-post_type menu-item-42">Werken bij Akro
<li id="menu-item-41" class="menu-item menu-item-type-post_type menu-item-41">Contractvoorwaarden<li id="menu-item-21" class="menu-item menu-item-type-post_type menu-item-21">Werkvelden
</div>
The second level just gets shown, and hovering of sublevel pages doesn’t work. Please, see https://www.akroconsult.nl/new for what I’m talking about.
What am I doing wrong??
- The topic ‘Trouble with hover menu’ is closed to new replies.