How do I get rid of the 'Home' link from appearing at the top of my links when using <?php wp_nav_menu( array('menu' => 'news', 'show_home' => false)); ?>
I tried 'show_home' => false
and 'show_home=0'
but neither worked.
This should be in your functions.php
function page_menu_args( $args ) {
$args['show_home'] = FALSE;
return $args;
}
add_filter( 'wp_page_menu_args', 'page_menu_args' );
EDIT: Dont forget to add this to wherever your menu is supposed to print out:
wp_nav_menu( array('echo'=>true));
The following worked for me:
_nav_menu( array( 'container_id' => 'topmenu', 'depth' => 0, 'menu_class' => 'sf-menu', 'theme_location' => 'topmenu' ) );
And I add
function page_menu_args( $args ) {
$args['show_home'] = FALSE;
return $args;
}
add_filter( 'wp_page_menu_args', 'page_menu_args' );
In the functions.php
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With