WordPress.org

Ready to get started?Download WordPress

Forums

Quark
[resolved] Hide the Menu. Both on Desktop and Mobile (3 posts)

  1. phillipc421
    Member
    Posted 11 months ago #

    Hey there,

    I was wondering if anyone code give me the code to hide the menu on both the Desktop version and mobile versions on the site, since the theme is responsive?

    Thanks,
    Phillip

  2. ahortin
    Member
    Theme Author

    Posted 11 months ago #

    If you don't want to display any menu whatsoever, then simply remove the following lines from header.php

    <nav id="site-navigation" class="main-navigation" role="navigation">
       <h3 class="menu-toggle assistive-text"><?php esc_html_e( 'Menu', 'quark' ); ?></h3>
       <div class="assistive-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'quark' ); ?>"><?php esc_html_e( 'Skip to content', 'quark' ); ?></a></div>
       <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
    </nav> <!-- /.site-navigation.main-navigation -->
  3. Matt Gross
    Member
    Posted 11 months ago #

    Hi there,

    If you'd like to hide the menu, but need to access it later for some reason, you could always attach a display: none; rule to the site-navigation ID, or main-navigation class in the style.css file.

    The rule should look something like

    #site-navigation {
        css rule;
        css rule;
        css rule;
    }

    You can just add the display: none; rule in with the others and it should cause the menu to disappear entirely, but you can always take the rule out if you need the menu back.

    Hope that helps,

    Matt

Reply

You must log in to post.

About this Theme

About this Topic