wp_nav_menu exclude home

How do I go about excluding the home page from my nav?
Does the home page have an ID number that I can throw in with the other excluded page ID's?

wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary', 'after' => '|', 'exclude' => '5,6,7,8,9,148' ) );

Thanks for your help,

Tim

    Mason

    Hiya Tim,

    First off, welcome to WPMU DEV!

    Are you referring to a particular theme? The 'home' link isn't included by default. If it's showing up in the menu I'd think the theme has it coded in there and then is set to show the nav menu.

    Anyway, a bit more detail and we'll get ya sorted.

    Thanks!

    tdillon
    • 3
    • #21,137

    I'm modifying twenty ten.

    Mason

    Hiya tdilion,

    Gotcha. There's no real way to 'exclude' an item in the menu. The whole point of this function is to provide the ability for folks to set up their own custom menu and add/exclude items from the admin interface.

    If you go to Appearance>Menus in the wp-admin you'll be able to create a custom menu and you can choose not to include the home link yourself.

    Here's the codex page for wp_nav_menu():
    http://codex.wordpress.org/Function_Reference/wp_nav_menu

    You can force a menu item to be there - or even have a fallback list of menu items if a custom one is created, but you can't have things excluded from the custom menu. Does that make sense?

    Let us know. Thanks!

Join 370541 happy members

Get access to our entire collection of epic plugins, astonishing themes & genius support

Become a member