Support » Themes and Templates » Removing the "Home" button from wp_nav_menu

  • Resolved Stefanovitsh


    Hello folks!

    I’m sure you have seen this question around a hundred times already, but the fact is, I can neither get my problem fixed, not understand its roots. Here’s the problem.

    I’m using wp_nav_menu function to display my navigation menu. But for some reason it creates another nameless list item in the list with a link to the main page. The first thing I did was, of course, search for a solution in Google. Many pages came out and I tried different stuff, but neither worked.

    Now, I know coding only on a basic level, but I’m developing my own theme from scratch. Since I can’t understand, where the problem lies, maybe you guys can help me find it?

    You can see the menu on this page:
    I’ve added some ugly visual styles, that might help you see it better.

    At this very moment, my functions.php file is as follows:

    	/* Menu Module */
    	add_theme_support( 'menus' );
    	/* Featured Image Module */
    	add_theme_support( 'post-thumbnails' );
    	function mytheme_nav_menu_args( $args ) {
    	    $args['show_home'] = false;
    	    return $args;
    	add_filter( 'wp_nav_menu_args', 'mytheme_nav_menu_args' );


Viewing 5 replies - 1 through 5 (of 5 total)
  • Update: It seems that it’s not really the wp_nav_menu, that is the source of the problem. I’ve just created a simple hard-coded list, but it still receives an extra div with a link to the homepage. And now I’m confused. Any ideas what might be the problem?

    Okay, nevermind. Fixed it.

    Moderator Andrew Nevins


    Can you post your solution for others to follow?

    Basically it was an attention problem. An unclosed tag. The a tag was open in logo image and I forgot to close it, so it added a link to every single element that separated it from the next closed a tag.

    just do one thing search on your theme “show_home” . you need to set this as a false. It works for me. I currently change in two pages of functions.php of plugin and themes ..
    Here i do following and works fine :

    $args[‘show_home’] = false;

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Removing the "Home" button from wp_nav_menu’ is closed to new replies.