- This topic has 9 replies, 2 voices, and was last updated 2 years, 4 months ago by David.
-
AuthorPosts
-
November 25, 2021 at 6:48 am #2021386Paul
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
November 25, 2021 at 7:10 am #2021422DavidStaffCustomer SupportHi 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.
November 25, 2021 at 7:47 am #2021490PaulI 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?
November 25, 2021 at 8:29 am #2021884DavidStaffCustomer SupportThe 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 thatNovember 25, 2021 at 8:37 am #2021903PaulI 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>
November 25, 2021 at 9:59 am #2022055DavidStaffCustomer SupportDo you have any custom functions or hook elements running on the site ?
November 26, 2021 at 1:53 am #2022842PaulI 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>
November 26, 2021 at 7:50 am #2024024DavidStaffCustomer SupportOdd… can you try using a Layout Element to disable the navigation:
https://docs.generatepress.com/article/layout-element-overview/
November 30, 2021 at 6:50 am #2031354PaulThat worked!
Thanks
November 30, 2021 at 7:27 am #2031421DavidStaffCustomer SupportGlad to hear that!
-
AuthorPosts
- You must be logged in to reply to this topic.