# Showing home button in a specified menu

I try to add the home button in a specified WordPress menu (I have 2) and it's not working at all.

This is my code:

<?php wp_nav_menu(array('theme_location' => 'primary', 'show_home' => $args['show_home'] = true)); ?>  Calling the 'global$args;' didn't work. What I'm doing wrong?

-

show_home isn't working for you because there is no show_home argument on wp_nav_menu. You will need to add it using the menu editor in the admin panel, most likely as a custom link.

These are the valid arguments:

$defaults = array( 'theme_location' => '', 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
'depth'           => 0,
'walker'          => ''
);


You've likely been given an example that has confused wp_nav_menu with wp_page_menu, which does have a show_home argument
As an extra note, you could modify items_wrap to include the markup for the first menu item, using home_url() as the URL, but experienced developers would frown upon this –  Tom J Nowell Apr 4 '14 at 17:42