Title: &quot;wp_nav_menu()&quot; function not working
Last modified: August 24, 2016

---

# "wp_nav_menu()" function not working

 *  [Truck35](https://wordpress.org/support/users/truck35/)
 * (@truck35)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/wp_nav_menu-function-not-working/)
 * I am trying to create my own theme and I am using the “wp_nav_menu()” function
   but, it is not working. The documentation on wordpress.org says that the function
   should return true if it finds the location and false if it doesn’t. My function
   returns no value which leads me to believe that the PHP is not recognizing the
   function call. Could someone help me out? I am new to WordPress and out of ideas.
 * Thanks,
    Kevin Haynes

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/wp_nav_menu-function-not-working/#post-6178417)
 * Can you post the contents of the PHP template where you call `wp_nav_menu()` 
   to [Pastebin](http://pastebin.com/) and post the link here? You must pass an 
   array to `wp_nav_menu()` even if there’s only one argument; are you doing that?
 *  Thread Starter [Truck35](https://wordpress.org/support/users/truck35/)
 * (@truck35)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/wp_nav_menu-function-not-working/#post-6178520)
 * I did not pass any arguments with my function. From what you said, this could
   be the reason why it is not working. Here is my code that I have in my header
   file in my theme:
 *     ```
       <div id="header">
       	<nav>
       		<?php echo wp_nav_menu(); ?>
       	</nav>
       	</div><!--header-->
       ```
   
 * Any help you could give me would be appreciated.
 * Thanks,
    Truck35
 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/wp_nav_menu-function-not-working/#post-6178525)
 * If you don’t pass any arguments to `wp_nav_menu()`, WordPress will display the
   first menu (sorted alphabetically) with items assigned to it. Since I’m guessing
   this isn’t what you want, you should pass the `theme_location` argument to the
   function:
 * `<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>`
 * (It isn’t necessary to `echo` the results of the function.) Have you called [`register_nav_menu()`](https://codex.wordpress.org/Function_Reference/register_nav_menu)
   to register a menu location? You’ll pass the `location` argument when you register
   a menu location, and you’ll pass the same string to `theme_location` when you
   call `wp_nav_menu()`. Is there a menu assigned to that location (Dashboard > 
   Appearance > Menu > Manage Locations)?
 *  Thread Starter [Truck35](https://wordpress.org/support/users/truck35/)
 * (@truck35)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/wp_nav_menu-function-not-working/#post-6178609)
 * Hi Mr. stephencottontail,
 * Thanks for the information. I’m going to try to pass an array as an argument 
   as you suggested. Sorry for taking so long to reply, busy doing other things 
   in addition to my IT stuff. I only echoed the function because it returns a Boolean
   value and I wanted to see if the function was working. I will post my result 
   of the “wp_nav_menu()” function call with an array passed as an argument as soon
   as possible.
 * Thanks for your help it is really appreciated.
 * Bless,
    Truck35

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘"wp_nav_menu()" function not working’ is closed to new replies.

## Tags

 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [tags](https://wordpress.org/support/topic-tag/tags/)
 * [Themes](https://wordpress.org/support/topic-tag/themes/)

 * 4 replies
 * 2 participants
 * Last reply from: [Truck35](https://wordpress.org/support/users/truck35/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/wp_nav_menu-function-not-working/#post-6178609)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
