• Hi Guys!
    Need your guides.
    How to hide the ‘Home’ menu in ‘wp_nav_menu()’ on twentytwelve theme?

    My code:
    <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu', 'show_home' => false ) ); ?>

    the ‘show_home’ => false is not working.

Viewing 11 replies - 1 through 11 (of 11 total)
  • using css,

    For Ex;

    your classname
    {
    display:none;
    }

    Thread Starter claudchan

    (@claudchan)

    There are no specific class name in the default menus.
    Anyone has better solutions?
    Thanks.

    hi,

    For ex:

    <div id=”nav-menu”>
    <?php wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘menu_class’ => ‘nav-menu’, ‘show_home’ => false ) ); ?>

    </div>

    css:

    #nav-menu your menu-classname
    {
    display:none;
    }

    if u need specific anyone menu then,

    #nav-menu your menu-classname your particular menu-name(say li tag)
    {
    display:none;
    }

    or send your site link!!!!!!!!!!!

    If you use a custom menu, you can rename the menu tabs anything you want. http://codex.wordpress.org/Appearance_Menus_Screen

    Thread Starter claudchan

    (@claudchan)

    Hi sonai,
    I am good in css. I not sure how you get you custom css name to specific.
    Here is what default wordpress show me:

    <div class="menu">
    	<ul>
    		<li class="current_page_item"><a href="http://fairedge.localhost/" title="Home">Home</a></li>
    		<li class="page_item page-item-5"><a href="http://fairedge.localhost/our-company/">Our Company</a>
    			<ul class="children">
    				<li class="page_item page-item-7"><a href="http://fairedge.localhost/our-company/about-us/">About Us</a></li>
    			</ul>
    		</li>
    	</ul>
    </div>

    There is no unique class name for ‘home’ for me to do it!

    Hi WPyogi.
    I did not plan to use custom menu, thought to let wordpress to handle the menus for me. If there is no options I can set in twentytwelve, then I have no choice to force use custom menus. >_<

    I wonder what is the purpose of the functions “[‘show_home’] = true;” for, if it doesn’t working.

    .menu, .menu ul li, .menu ul li a
    {
    display :none;
    }

    thats all!!!!!!!!!!!!

    Thread Starter claudchan

    (@claudchan)

    Hi sonai,
    I look into your css code sample it just going to hide all the menus instead.

    menu ul li a
    {
    display :none;
    }

    There is no such 'show_home' => false in wp_nav_menu()
    http://codex.wordpress.org/Function_Reference/wp_nav_menu

    Also, the HTML output shown above is not from wp_nav_menu() in the top of this topic, you can check the menu class on <ul>

    Looks like it’s from wp_page_menu() which has show_home in its $args.
    http://codex.wordpress.org/Function_Reference/wp_page_menu

    the showing of the ‘Home’ tab for the fallback default menu is set in functions.php of the theme;

    create a child theme for your customisations; http://codex.wordpress.org/Child_Themes
    in the child theme’s functions.php, add for example:

    function twentytwelvechild_page_menu_args( $args ) {
    	$args['show_home'] = false;
    	return $args;
    }
    add_filter( 'wp_page_menu_args', 'twentytwelvechild_page_menu_args', 40 );
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to hide 'Home' menu in wp_nav_menu (twentytwelve)?’ is closed to new replies.