[Resolved] Disable second nav menu on a single page

Home Forums Support [Resolved] Disable second nav menu on a single page

Home Forums Support Disable second nav menu on a single page

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2021386
    Paul

    I have the following page which is to be read by another system and I need to keep the page as lean as possible.

    Using another plugin (I don’t know if GP can strip out unused css/javascript?) I’ve managed to make the page fairly lean, however I’m still getting my Second nav menu displayed.

    Is there a way I can turn this off e.g. not outputted rather than hiding it

    https://www.suddencardiacarrestuk.org/faq-all/

    #2021422
    David
    Staff
    Customer Support

    Hi there,

    you can use the Disable Elements Meta Box in the page editor:

    https://docs.generatepress.com/article/disable-elements-overview/

    The list will include the Secondary Nav for sites with it enabled.

    #2021490
    Paul

    I have used that feature and the menu still appears.

    Does that actually stop the output of the HTML code?

    I say that, as I’ve disabled lots of javascript/css being outputted with the other plugin – could that be to blame? If so, do you know what?

    #2021884
    David
    Staff
    Customer Support

    The Disable Elements is a server side function (PHP) that will unhook that template part / function. So there should be no HTML output at all.

    If its not going away then try clearing any server side page caches.
    If its still not working then there must be some other function or changes to the template affecting that

    #2021903
    Paul

    I found that toggling the inclusion of “/wp-content/themes/generatepress/assets/css/style.min.css” made the menu appear or not.

    Searching the source I can see that the menu HTML has been output…

    
    <button class="menu-toggle secondary-menu-toggle">
    <span class="mobile-menu">Menu</span> </button>
    <div class="main-nav"><ul id="menu-top-bar-menu" class=" secondary-menu sf-menu"><li id="menu-item-9044" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9044"><a href="https://www.suddencardiacarrestuk.org/shop/">Shop</a></li>
    <li id="menu-item-9045" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9045"><a href="https://www.suddencardiacarrestuk.org/donate/">Donate</a></li>
    <li id="menu-item-9046" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9046"><a href="https://www.suddencardiacarrestuk.org/about-us/">About</a></li>
    <li id="menu-item-9047" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9047"><a href="https://www.suddencardiacarrestuk.org/contact/">Contact</a></li>
    <li id="menu-item-9048" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-9048"><a href="https://facebook.com/SuddenCardiacArrestUK"><i class="_mi dashicons dashicons-facebook" aria-hidden="true" style="font-size:1.8em;"></i></a></li>
    <li id="menu-item-9049" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-9049"><a href="https://twitter.com/WeAreSCAUK"><i class="_mi dashicons dashicons-twitter" aria-hidden="true" style="font-size:1.8em;"></i></a></li>
    <li id="menu-item-9109" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-9109"><a href="https://www.youtube.com/channel/UCJkb9cJprDJc8XokVMo8ENw"><i class="_mi dashicons dashicons-youtube" aria-hidden="true" style="font-size:1.8em;"></i></a></li>
    <li id="menu-item-13021" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-13021"><a href="https://www.instagram.com/suddencardiacarrestuk/"><i class="_mi dashicons dashicons-instagram" aria-hidden="true" style="font-size:1.8em;"></i></a></li>
    </ul></div> </div>
    
    #2022055
    David
    Staff
    Customer Support

    Do you have any custom functions or hook elements running on the site ?

    #2022842
    Paul

    I have one hook to add a yoast breadcrumb. The page wasn’t excluded, but it is now and the mobile menu is still in the code

    <?php
    if ( function_exists(‘yoast_breadcrumb’) ) {
    yoast_breadcrumb( ‘

    <p id=”breadcrumbs”>’,'</p>

    ‘ );
    }
    ?>

    <button class="menu-toggle secondary-menu-toggle">
    <span class="mobile-menu">Menu</span> </button>
    <div class="main-nav"><ul id="menu-top-bar-menu" class=" secondary-menu sf-menu"><li id="menu-item-9044" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9044"><a href="https://www.suddencardiacarrestuk.org/shop/">Shop</a></li>
    <li id="menu-item-9045" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9045"><a href="https://www.suddencardiacarrestuk.org/donate/">Donate</a></li>
    <li id="menu-item-9046" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9046"><a href="https://www.suddencardiacarrestuk.org/about-us/">About</a></li>
    <li id="menu-item-9047" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9047"><a href="https://www.suddencardiacarrestuk.org/contact/">Contact</a></li>
    <li id="menu-item-9048" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-9048"><a href="https://facebook.com/SuddenCardiacArrestUK"><i class="_mi dashicons dashicons-facebook" aria-hidden="true" style="font-size:1.8em;"></i></a></li>
    <li id="menu-item-9049" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-9049"><a href="https://twitter.com/WeAreSCAUK"><i class="_mi dashicons dashicons-twitter" aria-hidden="true" style="font-size:1.8em;"></i></a></li>
    <li id="menu-item-9109" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-9109"><a href="https://www.youtube.com/channel/UCJkb9cJprDJc8XokVMo8ENw"><i class="_mi dashicons dashicons-youtube" aria-hidden="true" style="font-size:1.8em;"></i></a></li>
    <li id="menu-item-13021" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-13021"><a href="https://www.instagram.com/suddencardiacarrestuk/"><i class="_mi dashicons dashicons-instagram" aria-hidden="true" style="font-size:1.8em;"></i></a></li>
    </ul></div> </div>
    </nav>
    #2024024
    David
    Staff
    Customer Support

    Odd… can you try using a Layout Element to disable the navigation:

    https://docs.generatepress.com/article/layout-element-overview/

    #2031354
    Paul

    That worked!

    Thanks

    #2031421
    David
    Staff
    Customer Support
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.