Forums

[resolved] Remove menu from Twenty Ten Theme? (4 posts)

  1. cassettewalkmans
    Member
    Posted 2 years ago #

    How do you completely remove or hide the Menu when using the Twenty Ten theme?

    Any suggestions would be appreciated.

    Thanks!

  2. MAS
    Member
    Posted 2 years ago #

    remove wp_nav_menu(...) function from header.php file.

  3. Digital Raindrops
    Member
    Posted 2 years ago #

    If you choose to delete the line then remark it rather than delete it, just incase you want to reinstate it later.

    <?php /* REMOVED wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); */ ?>

    Another maybe better way is to make the menu optional, by default the navigation has a fall back to the WordPress page menu 'fallback_cb' => 'wp_page_menu'

    You could just add an argument to remove the menu, and later if you want to show the menu you can just switch it on by setting it in the admin area's Menu Locations.

    If you prefer this method the current code line found in header.php
    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>

    Make the menu optional:
    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary','fallback_cb' => '' ) ); ?>

    Now the menu will only show if you assign a menu in the admin section.

    Using a child theme or a copy is a good method as you do not have to add the changes everytime the default twenty ten theme is updated.

    David

  4. cassettewalkmans
    Member
    Posted 2 years ago #

    Both your suggestions were awesome - appreciate it heaps! Problem solved.

Topic Closed

This topic has been closed to new replies.

About this Topic