Mobile Menu Dropdown Fix: Make the Parent Menu Item Clickable

Quick Summary
- CSS repositions the mobile menu's dropdown toggle and its arrow so a parent item's link stays clickable instead of only opening the submenu.
- The toggle is stretched to full width and floated right, with its arrow pushed right, then moved left while the submenu is open.
- Match the #menu-header-menu ID and a.open-children toggle class to your own theme, and keep the rules inside your mobile media query.
In some themes, a mobile menu parent item with a submenu gets an extra toggle link that opens the dropdown. When that toggle gets in the way of the parent link, tapping the parent only opens the submenu and visitors can’t reach the parent page. This CSS repositions the toggle and its arrow so the parent link stays clickable.
Add it to your theme’s responsive CSS, inside the media query for your mobile menu, so the desktop menu isn’t affected.
ul#menu-header-menu a.open-children {
min-width: 100%;
float: right;
}
ul#menu-header-menu a.open-children i {
text-align: right;
float: right;
}
ul#menu-header-menu li.menu-item-has-children.active a.open-children i {
float: left;
}How it works
ul#menu-header-menuis the menu list. WordPress gives it the IDmenu-followed by the menu’s slug, so a menu named Header Menu becomes#menu-header-menu. Change it to match your menu.a.open-childrenis the class the original theme uses for its dropdown toggle. Your theme may use a different one, so check it with your browser’s inspector.- The first rule stretches the toggle to the full width of the menu and floats it right. The second pushes its arrow icon (
i) to the right edge. - The third rule moves the arrow to the left while the parent item has the
activeclass, which marks the open submenu in this theme.menu-item-has-childrenis the class WordPress adds to every item with a submenu, the same class you can use to show a dropdown arrow on parent items.
Clear your cache and test on a real phone after adding it, since menu scripts and styles differ from theme to theme.
Related articles
- keeping a submenu open on diagonal mouse moves: the desktop side of dropdown menu problems
- highlighting the current page in a WordPress menu: more of the classes WordPress adds to menu items
