Troubleshooting Common Twenty Eleven Theme Menu Issues
Content
Menus are a vital part of any WordPress website, and the Twenty Eleven theme provides a solid foundation for navigation. However, users often encounter specific challenges when customizing them. Based on community discussions, here are the most common menu-related issues and their solutions.
1. Submenus Displaying Incorrectly in Certain Browsers
The Problem: Your dropdown submenus appear as a single, wide bar or display vertically instead of horizontally in browsers like Internet Explorer or Firefox, while working fine in Chrome.
Why It Happens: This is almost always caused by invalid HTML or CSS code. Browsers have different rendering engines, and some are less forgiving of code errors than others.
The Solution: Validate your code. Run your site's pages through the W3C Markup Validation Service. Strive to fix any errors or warnings reported, as this will greatly improve cross-browser compatibility.
2. Needing a Second Custom Menu
The Problem: The Twenty Eleven theme by default only has one designated 'Primary' menu location. You want to add a second, separate menu (e.g., in the footer).
Why It Happens: This is a design limitation of the base theme, not a bug.
The Solution: You must use a child theme. Never edit the core Twenty Eleven files directly. In your child theme's functions.php file, add the following code to register a new menu location:
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'your-child-theme-name' ),
'secondary' => __( 'Secondary Menu', 'your-child-theme-name' ),
) );
After adding this, a new 'Secondary Menu' location will appear under Appearance > Menus. You can then display this menu in your theme template files (e.g., footer.php) using:
<?php wp_nav_menu( array( 'theme_location' => 'secondary' ) ); ?>
3. Menus Not Displaying in the Correct Order
The Problem: Menu items appear in the wrong sequence on your site.
Why It Happens: The menu order is controlled within the WordPress admin area, not the theme itself.
The Solution: Navigate to Appearance > Menus in your WordPress dashboard. Simply drag and drop your menu items into your desired order. You can also create sub-menus by dragging a menu item slightly to the right underneath another item.
4. Creating a Horizontal Submenu (Mega-Menu)
The Problem: You want submenu items to display in a horizontal layout, creating a 'mega-menu' effect, rather than the default vertical stack.
Why It Happens: This requires significant customization of the default theme's CSS structure.
The Solution: This is an advanced modification. The Twenty Eleven theme does not support this natively. Achieving this typically involves using a dedicated mega-menu plugin or writing extensive custom CSS to override the default styles for the #access ul ul selector, changing its width and the float properties of the list items within it.
5. The Importance of a Child Theme
A critical piece of advice that appears in multiple threads: always use a child theme for any customizations to Twenty Eleven. Editing the parent theme directly means your changes will be overwritten the next time you update WordPress, potentially breaking your site. A child theme protects your modifications and is considered a WordPress best practice.
By following these guidelines, you can resolve the majority of common menu issues encountered in the Twenty Eleven theme. For more complex functionality, like smooth scrolling or advanced third-level menu support, exploring dedicated plugins is often the most efficient path.
Related Support Threads Support
-
horizontal submenuhttps://wordpress.org/support/topic/horizontal-submenu-2/
-
[Theme: Twenty Eleven] Menuhttps://wordpress.org/support/topic/theme-twenty-eleven-menu/
-
three level menu is hidinghttps://wordpress.org/support/topic/three-level-menu-is-hiding/
-
[Theme: Twenty Eleven] Menu on Top – Submenu not workinghttps://wordpress.org/support/topic/theme-twenty-eleven-menu-on-top-submenu-not-working/
-
[twentyeleven] Sub menu doesn't display correctly in IE and Firefoxhttps://wordpress.org/support/topic/twentyeleven-sub-menu-doesnt-display-correctly-in-ie-and-firefox/
-
how to increase no of menu items in 2011 theme??https://wordpress.org/support/topic/how-to-increase-no-of-menu-items-in-2011-theme-1/
-
twentyeleven menu displays vertically in ie8 (only)https://wordpress.org/support/topic/twentyeleven-menu-displays-vertically-in-ie8-only/
-
smooth scrollhttps://wordpress.org/support/topic/smooth-scroll/
-
[Theme: Twenty Eleven] How to make more than one menu?https://wordpress.org/support/topic/theme-twenty-eleven-how-to-make-more-than-one-menu/
-
[Theme: Twenty Eleven] Adding sub-menu items in Twentyeleven themehttps://wordpress.org/support/topic/theme-twenty-eleven-adding-sub-menu-items-in-twentyeleven-theme/
-
[Theme: Twenty Eleven] Menu bar loses style when in a frame viewed in IE9https://wordpress.org/support/topic/theme-twenty-eleven-menu-bar-loses-style-when-in-a-frame-viewed-in-ie9/
-
how to have small arrow pointer in Header submenu2011?https://wordpress.org/support/topic/how-to-have-small-arrow-pointer-in-header-submenu2011/
-
[Theme: Twenty Eleven] How to create a drop down menu on the main menu bar?https://wordpress.org/support/topic/theme-twenty-eleven-how-to-create-a-drop-down-menu-on-the-main-menu-bar/
-
menuhttps://wordpress.org/support/topic/menu-links-dropping-to-next-line/
-
[Theme: Twenty Eleven] Styling a horizontal submenu of child pageshttps://wordpress.org/support/topic/theme-twenty-eleven-styling-a-horizontal-submenu-of-child-pages/
-
Does twentyeleven theme has 3rd level menu support??https://wordpress.org/support/topic/does-twentyeleven-theme-has-3rd-level-menu-support/
-
What's the mechanism of controlling the navigation menu in Twentyeleven?https://wordpress.org/support/topic/whats-the-mechanism-of-controlling-the-navigation-menu-in-twentyeleven/
-
[Theme: Twenty Eleven] CSS3 animation for sub navigationhttps://wordpress.org/support/topic/theme-twenty-eleven-css3-animation-for-sub-navigation/
-
[Theme: Twenty Eleven] Second Custom Menu Flattens Sub-Menu Itemshttps://wordpress.org/support/topic/theme-twenty-eleven-second-custom-menu-flattens-sub-menu-items/
-
Different Menu on a Different Pagehttps://wordpress.org/support/topic/different-menu-on-a-different-page/
-
How do I make sidebar menu appear above content on narrow/responsive display?https://wordpress.org/support/topic/how-do-i-make-sidebar-menu-appear-above-content-on-narrowresponsive-display/
-
Add a mobile responsive "toggle" or "hamburger" menu to Twenty Eleven?https://wordpress.org/support/topic/add-a-mobile-responsive-toggle-or-hamburger-menu-to-twenty-eleven/
-
On Adding Second Menu to Twenty Elevenhttps://wordpress.org/support/topic/on-adding-second-menu-to-twenty-eleven/