Support » Themes and Templates » Is it possible to hide menu completely in home page?

  • I want to use an introduction page as my homepage, so I don’t want to show any menu on it.

    Is it possible? is there any plugin doing that?

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You could use a built-in WordPress function to test whether the page being viewed is the Front Page, hide the menu if it is, then show the menu if it is not the front page. This requires some php coding, so you will need to get comfortable with that.

    Not knowing how your menu in inserted, here is an example that works with the default Twenty Eleven theme, inside the header.php file:

    <?php if ( is_front_page() ) {
            echo 'Foo';
            }
    	else
    	{
                 wp_nav_menu( array( 'theme_location' => 'primary' ) );
    	}
    ?>

    The wp_nav_menu code is how WP adds the custom menu to the page; by wrapping it in an if / else construct you are testing whether we are on the front page, if we are, send the popular Foo statement instead of the menu (you can also echo an empty string to eliminate the space where the menu would be). Assuming you have given the user a way to get deeper into the site (off the front page), the else construct kicks in and shows the menu on all other pages & posts.

    Thank you for your reply.

    I am using Graphene theme, I don’t know PHP programming, could you please take a look at the theme and tell me how to make changes?

    Thank you very much.

    Thank you for enlightening, I got it working.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is it possible to hide menu completely in home page?’ is closed to new replies.