Support » Themes and Templates » wp_nav_menu Home Link

  • Resolved Phil Bowell


    I’m trying to remove the link to the home page in my wp_nav_menu but it’s not working. The him page is a static page I set in the preferences. I found this but it doesn’t seem to work so I’m obviously doing something wrong. Is there a better way to do this?

    This is my functions.php:

    register_nav_menus(array('primary' => 'Primary Navigation'));
    	/* Remove Home Page Link */
    	function mytheme_nav_menu_args( $args ) {
    	    $args['show_home'] = false;
    	    return $args;
    	add_filter( 'wp_nav_menu_args', 'mytheme_nav_menu_args' );

    This is in my header:

    <?php wp_nav_menu( array( 'echo' => true , 'theme_location' => 'Primary Menu' , 'depth' => '1' ) ); ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘wp_nav_menu Home Link’ is closed to new replies.