Guide · Updated September 2026

WordPress Menu Not Showing in Custom Theme: The Ultimate Troubleshooting Guide

If your WordPress menu isn't displaying in your custom theme, it's typically due to missing registration, incorrect theme location assignment, or styling issues. This guide will walk you through the precise steps to diagnose and fix the problem, ensuring your navigation appears correctly.

Do it yourself in about a minute

Install Themify and get your first conversion free — no credit card.

Chrome browser logoAdd to Chrome — free

Understanding How WordPress Menus Work (A Quick Primer)

Before diving into troubleshooting, it's crucial to understand the fundamental architecture of WordPress menus. At its core, WordPress manages two distinct aspects: the menu data itself (links, pages, categories) and the 'theme locations' where these menus can be displayed. A theme location is essentially a placeholder defined by your theme, indicating an area where a menu can be assigned – think of it as a designated slot like 'Primary Navigation' or 'Footer Menu'.

When you create a menu in the WordPress dashboard (Appearance → Menus), you're populating the menu data. However, for that menu to appear on your site, you must assign it to one of your theme's registered locations. If your theme hasn't registered any locations, or if the menu isn't assigned to the correct one, it simply won't show up. Furthermore, your theme's code is responsible for actually rendering the menu structure onto the front end, typically using the `wp_nav_menu()` function, and applying appropriate CSS for visual presentation. A misalignment at any of these stages can cause the 'menu not showing' issue.

Initial Checks: Is the Menu Created and Assigned?

Often, the simplest solutions are overlooked. Before digging into theme files, confirm that your menu is correctly set up within the WordPress admin.

This foundational check takes mere moments but resolves a significant percentage of 'menu not showing' issues. It confirms that the menu data exists and that WordPress knows where it should go.

Another common oversight is forgetting to save changes. After making any adjustments in the Appearance → Menus screen, always ensure you click the 'Save Menu' button. WordPress does not automatically save menu assignments or structural changes.

  1. Navigate to your WordPress dashboard (e.g., `yourdomain.com/wp-admin`).
  2. Go to Appearance → Menus.
  3. Check if you have a menu created. If not, create one by entering a 'Menu Name' (e.g., 'Main Navigation') and clicking 'Create Menu'.
  4. Add items to your menu (e.g., Pages, Custom Links, Categories) and click 'Add to Menu'.
  5. Under 'Menu Settings' (usually on the left or bottom), look for 'Display location'.
  6. Select the appropriate theme location for your menu (e.g., 'Primary Navigation', 'Header Menu').
  7. Click 'Save Menu'.

Troubleshooting Theme Code: Registering Menu Locations in functions.php

If your menu is created and assigned, but still not appearing, the problem almost certainly lies within your custom theme's code. The first place to check is your theme's `functions.php` file, where menu locations must be registered. Without this registration, WordPress doesn't know where to offer those 'Display location' options you saw in the dashboard, and thus, your theme has no designated 'slots' for menus.

You'll need to access your theme files. The safest way is via an SFTP client (like FileZilla) or your hosting provider's file manager. Avoid making direct edits in Appearance → Theme File Editor unless you are very comfortable, as a single syntax error can break your site. Always back up `functions.php` before editing.

The `register_nav_menus()` function is what creates these locations. It takes an array of location IDs and their human-readable names. For example, if you want a main navigation and a footer navigation, you'd register them like this.

After adding this code, save `functions.php` and re-check Appearance → Menus. You should now see 'Primary' and 'Footer' as available display locations. Assign your menu to 'Primary' (or whichever location you intended) and save the menu. This step ensures WordPress recognizes your theme's navigation areas.

  1. <?php
  2. function themify_register_theme_menus() {
  3. register_nav_menus( array(
  4. 'primary' => __( 'Primary Navigation', 'your-text-domain' ),
  5. 'footer' => __( 'Footer Menu', 'your-text-domain' ),
  6. ) );
  7. }
  8. add_action( 'after_setup_theme', 'themify_register_theme_menus' );
  9. ?>
  • Locate your theme's `functions.php` file (usually in `wp-content/themes/your-custom-theme-name/functions.php`).
  • Open `functions.php` for editing.
  • Look for `register_nav_menus()` or a similar function. If it's missing, add the following code (or modify an existing one):

Displaying the Menu: Calling `wp_nav_menu()` in Theme Templates

Registering theme locations in `functions.php` is only half the battle. The other crucial step is telling your theme where to actually display the menu. This is done by calling the `wp_nav_menu()` function in the relevant template files, such as `header.php`, `footer.php`, or even `index.php`.

The `wp_nav_menu()` function needs to be placed exactly where you want the menu to appear. It accepts an array of arguments to customize its behavior, with `theme_location` being the most critical for connecting to your registered location.

A common mistake is forgetting to call this function, or calling it with an incorrect `theme_location` ID (e.g., `'main'` instead of `'primary'`). The `container` and `container_class` arguments are also useful for wrapping your menu in a `div` for easier styling. After adding this code, save the template file and refresh your site. If all previous steps were correct, your menu should now be visible.

If you're building a theme from scratch, tools like Themify can significantly streamline this process by automatically generating valid WordPress theme files with correctly implemented navigation structures directly from a live webpage, saving hours of manual coding and debugging.

  1. <!-- For Primary Navigation in header.php -->
  2. <nav id="site-navigation" class="main-navigation">
  3. <?php
  4. wp_nav_menu( array(
  5. 'theme_location' => 'primary',
  6. 'container' => 'div',
  7. 'container_class'=> 'menu-main-menu-container',
  8. 'menu_class' => 'primary-menu',
  9. 'fallback_cb' => 'wp_page_menu'
  10. ) );
  11. ?>
  12. </nav>
  13. <!-- For Footer Menu in footer.php -->
  14. <nav id="footer-navigation" class="footer-navigation">
  15. <?php
  16. wp_nav_menu( array(
  17. 'theme_location' => 'footer',
  18. 'container' => 'div',
  19. 'container_class'=> 'menu-footer-menu-container',
  20. 'menu_class' => 'footer-menu',
  21. 'depth' => 1
  22. ) );
  23. ?>
  24. </nav>
  • Identify the template file where you want your menu to appear (e.g., `header.php` for a primary navigation, `footer.php` for a footer menu).
  • Open the chosen template file for editing (again, via SFTP or file manager).
  • Locate the HTML section where you want the menu outputted (e.g., within your `<header>` tag, or before the closing `</body>` tag for a footer menu).
  • Insert the `wp_nav_menu()` function, ensuring the `theme_location` argument matches one of the IDs you registered in `functions.php`:

Addressing Styling and Visibility: CSS Overrides and Theme Structure

Even if your menu is correctly registered and displayed, it might still appear 'invisible' or malformed due to CSS. Modern themes often use CSS to style navigation, including properties like `display: none;`, `opacity: 0;`, `position: absolute;` with no defined `top`/`left`, or `z-index` conflicts that can hide the menu. A common culprit is responsive design, where a menu might be hidden by default on desktop and only appears when a 'hamburger' icon is clicked.

Your `style.css` file (located in your theme's root directory) is the primary place for menu styling. Inspecting the element using your browser's developer tools (right-click -> Inspect) is invaluable here. Look for classes applied to your menu (e.g., `.primary-menu`, `.main-navigation`) and check their CSS properties. If you see `display: none;`, that's your problem.

You might need to override existing styles. Add your custom CSS to `style.css` or, better yet, a dedicated stylesheet if your theme supports it (e.g., `custom.css`). For responsive menus, ensure your JavaScript for toggling the menu's visibility is correctly linked and functional.

For example, if you find that your menu (`.primary-menu`) is hidden, you might add:

Additionally, ensure the menu container itself (`.site-navigation` or `.main-navigation`) is not accidentally hidden. Also, check for negative margins or very small heights/widths on parent elements that could be clipping the menu. The goal here is to visually confirm the menu is present in the DOM and then adjust its appearance via CSS.

  1. /* Example of overriding hidden menu */
  2. .primary-menu {
  3. display: flex !important; /* Or block, inline-block, etc. depending on layout */
  4. visibility: visible !important;
  5. opacity: 1 !important;
  6. }
  7. /* Example for mobile menu that might be hidden by default */
  8. @media (max-width: 768px) {
  9. .mobile-menu-toggle { display: block; } /* Show hamburger icon */
  10. .primary-menu { display: none; } /* Hide menu by default */
  11. .primary-menu.active { display: block; } /* Show when active */
  12. }
  • Open your browser's developer tools (usually F12 or right-click -> Inspect Element).
  • Navigate to your site and visually inspect the area where the menu should be. Even if you don't see it, it might be in the HTML.
  • Using the 'Elements' tab, locate the HTML structure generated by `wp_nav_menu()` (look for `<ul>` with classes like `primary-menu` or `nav-menu`).
  • In the 'Styles' tab, examine the CSS applied to these elements and their parent containers. Look for properties like `display: none;`, `visibility: hidden;`, `opacity: 0;`, or `height: 0;`.
  • If you find conflicting styles, add or adjust CSS in your theme's `style.css` to make the menu visible.
  • Check for JavaScript errors in the 'Console' tab of developer tools, especially if your menu relies on JS for mobile toggles or dropdowns. An error here can prevent the menu from appearing or functioning.

Advanced Debugging: Conditional Logic and Plugin Conflicts

Sometimes, the problem goes beyond simple code omissions. If you've been using conditional logic (`if`, `else`) around your `wp_nav_menu()` function, ensure those conditions are always met. For instance, if your menu is wrapped in `if ( is_user_logged_in() )`, it will only appear for logged-in users. Verify that any conditional statements are correct for your intended audience.

Plugin conflicts are another common, albeit harder to diagnose, issue. A plugin might be enqueueing conflicting JavaScript or CSS that interferes with your theme's menu display or functionality. Deactivate all plugins and check if the menu reappears. If it does, reactivate them one by one to pinpoint the culprit.

Furthermore, ensure your theme is properly enqueuing its scripts and styles using `wp_enqueue_script()` and `wp_enqueue_style()` in `functions.php`. If scripts or styles are hardcoded or enqueued incorrectly, they might not load, leading to visual or functional issues with your menu. A well-constructed theme will leverage the WordPress enqueue system, often within a setup function hooked to `wp_enqueue_scripts`.

For complex cases, temporarily switching to a default WordPress theme (like Twenty Twenty-Four) can help isolate whether the issue is truly with your custom theme or a broader WordPress installation problem. If the menu works in a default theme, you can definitively narrow your focus to your custom theme's files.

  • Review any conditional logic surrounding `wp_nav_menu()` to ensure it doesn't inadvertently hide the menu from certain users or on specific page types.
  • Temporarily deactivate all plugins (go to Plugins → Installed Plugins, select all, and choose 'Deactivate' from the bulk actions dropdown). Check if the menu appears. If so, reactivate plugins one by one to find the conflicting one.
  • Verify that your theme correctly enqueues all necessary JavaScript and CSS files, especially those related to menu functionality. Look for `wp_enqueue_script()` and `wp_enqueue_style()` calls in `functions.php`.
  • Check your `wp-config.php` file for `WP_DEBUG` and `WP_DEBUG_LOG` settings. Set them to `true` to enable error logging, which can reveal PHP errors preventing menu code from executing.
  • Consider installing a debugging plugin like Query Monitor to analyze script dependencies and potential errors on the front end.

Verifying the Fix: What to Look For

Once you've applied a fix, it's essential to verify that your menu is not only visible but also fully functional and consistent across different contexts. A thorough verification process ensures you've resolved the issue comprehensively.

After implementing any changes, always clear your site's cache (if you're using a caching plugin or server-side caching) and your browser's cache. Old cached content can often mask your fixes, making it seem like the problem persists.

Check your website on various devices (desktop, tablet, mobile) and browsers (Chrome, Firefox, Safari, Edge) to ensure responsiveness and cross-browser compatibility. A menu that looks perfect on desktop Chrome might be broken on a mobile Safari due to responsive CSS or JavaScript issues. Pay particular attention to sub-menus and hover/click states.

If your custom theme was built from a live page using a tool like Themify, you'll know that the generated theme will have a robust navigation structure that typically translates well. However, manual modifications post-generation might require these verification steps.

Finally, always check for any new errors in your browser's developer console after the fix. Sometimes, resolving one issue can unintentionally introduce another, especially with complex JavaScript interactions. A clean console is a good sign of a stable fix. If you've been struggling to create a robust custom theme, using Themify to convert your designs ensures a solid base with correctly implemented WordPress features, significantly reducing troubleshooting time.

  • Clear your website's cache (plugin cache, server cache) and your browser's cache.
  • Open your website in an incognito/private browser window to ensure you're seeing the fresh, uncached version.
  • Verify that the main menu is visible and correctly positioned on all pages.
  • Check that all menu items link to the correct destinations.
  • If you have sub-menus, ensure they appear on hover or click and are properly styled.
  • Test responsiveness: shrink your browser window or view on a mobile device to confirm the mobile menu (e.g., hamburger icon) appears and functions correctly.
  • Inspect the HTML and CSS in your browser's developer tools to confirm the `wp_nav_menu()` function is outputting the expected structure and applying the desired classes and styles.
  • Check the browser's JavaScript console for any new errors after the fix.

Frequently asked questions

Why does my WordPress menu disappear on mobile?
Your WordPress menu likely disappears on mobile due to responsive CSS that hides the full menu and typically displays a 'hamburger' icon instead. Ensure your theme has JavaScript enabled to toggle the mobile menu's visibility and that the CSS rules for your mobile breakpoint are correctly defined to show the menu when the toggle is active.
How do I add a new menu location to my custom WordPress theme?
To add a new menu location, you must register it in your theme's `functions.php` file using `register_nav_menus()`. Then, call the `wp_nav_menu()` function in the desired template file (e.g., `header.php`, `footer.php`) with the matching `theme_location` argument to display it.
What is the `wp_nav_menu()` function and how does it work?
The `wp_nav_menu()` function is a core WordPress function used in theme template files to display a navigation menu. It takes an array of arguments, most notably `theme_location`, to specify which registered menu location should be outputted, allowing for highly customizable menu displays.
My menu is showing, but it's not styled. What's wrong?
If your menu appears but lacks styling, it's almost certainly a CSS issue. Your theme's `style.css` might not be loading, or it lacks specific rules for the menu's generated HTML classes (e.g., `.menu`, `.menu-item`, `.current-menu-item`). Use browser developer tools to inspect the menu's HTML and apply appropriate CSS rules to its classes and IDs.
Can I have multiple menus in my custom WordPress theme?
Yes, you can have multiple menus in your custom WordPress theme by registering multiple theme locations in `functions.php` (e.g., 'primary', 'footer', 'sidebar') and then calling `wp_nav_menu()` for each location in the appropriate theme template files, assigning a different menu to each location in the Appearance → Menus section.

Try it in minutes — first conversion free

Themify is the fastest way to turn any live webpage into an installable WordPress theme (.zip). No coding, no rebuilding, no design handoff. Runs 100% locally in your browser.

No credit card required · 14-day money-back guarantee

Chrome browser logoAdd to Chrome — 1 free conversion