Tagged: x
-
AuthorPosts
-
January 8, 2017 at 12:59 pm #1321280
wisdomandcraftParticipantHi – I found a few posts on this topic, but nothing solved definitively. Here’s the scenario – Two menus on the same page – 1) the main menu provided by the theme, and 2) a submenu appearing on only one page.
When I turn on the one-page nav through Cornerstone and select the submenu, the main menu disappears. Is there a way to keep the main menu and add the sub menu at the same time?
Thanks for your help,
ChrisJanuary 8, 2017 at 2:35 pm #1321376
NicoModeratorHi There,
Thanks for writing in.
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / passwordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
January 8, 2017 at 7:52 pm #1321707
wisdomandcraftParticipantThis reply has been marked as private.January 8, 2017 at 8:31 pm #1321727
wisdomandcraftParticipantThis reply has been marked as private.January 9, 2017 at 12:13 am #1321863
Rue NelModeratorHello There,
Thanks for updating in! Regretfully the given access to your WP dashboard is now working for us. It looks like the username is invalid. Please double check it for us. Meanwhile, when you apply the one page navigation menu, your will need two sets of menu. One menu will be for the primary menu and the second menu which would have the sub menu, will be used exclusively for the one page navigation menu.
Hope this helps. Please let us know how it goes.
January 9, 2017 at 10:51 am #1322618
wisdomandcraftParticipantThis reply has been marked as private.January 9, 2017 at 1:36 pm #1322802
JadeModeratorHI there,
Please follow the instructions on this thread: https://community.theme.co/forums/topic/add-an-additional-menu-under-the-top-menu/#post-28739
Hope this helps.
January 10, 2017 at 11:15 am #1324198
wisdomandcraftParticipantOkay. Thanks! I added the sub-menu – 2 things though: how do I get it take on the x-theme scrollspy? AND make the primary the “main menu”? The one-page is still swapping out the primary menu and putting in the sub.
January 10, 2017 at 7:38 pm #1324857
wisdomandcraftParticipantOkay – this seems buggy… After adding this to functions.php
function register_submenu() { register_nav_menu('submenu',__( 'Sub Menu' )); } add_action( 'init', 'register_submenu' );I added this to the theme:
<div class="submenu-container"> <?php wp_nav_menu( array( 'theme_location' => 'submenu', 'container_class' => 'submenu' ) ); ?> </div>Which gives me a second menu on the page, but when I select this for the one-page nav, it puts the submenu nav in the primary spot – even though the menu in the submenu spot. Please help, i’ve been dealing with this for days and we’re trying launch the site this week.
January 10, 2017 at 7:40 pm #1324859
wisdomandcraftParticipantOh, also, how can have this appear on only one page? i.e. use Cornerstone to apply the navigation?
January 10, 2017 at 10:54 pm #1325012
ChristopherModeratorHi there,
Please update your code to :
<?php if (is_page('34')): ?> <div class="submenu-container"> <?php wp_nav_menu( array( 'theme_location' => 'submenu', 'container_class' => 'submenu', 'container' => false, 'menu_class' => 'x-nav x-nav-scrollspy', 'link_before' => '<span>', 'link_after' => '</span>' )); ?> </div> <?php endif; ?>It should be displayed on page with ID 34.
Hope it helps.
January 11, 2017 at 7:39 am #1325513
wisdomandcraftParticipantOkay.
It was actually page ID 44, but this is starting to work. We’re getting really close. Thank you so much!It links down to the sections, but what do we do to highlight a link for the section in view? That is, how do we append the “current-menu-item” class to the link’s class attribute?
From there, I should be able to apply remaining styles.
Thanks again!
CJanuary 11, 2017 at 11:37 am #1325866
wisdomandcraftParticipantThis reply has been marked as private.January 11, 2017 at 3:25 pm #1326146
RadModeratorHi there,
Please add this code to Admin > Appearance > Customizer > Custom > Javascript
jQuery( function($) { $('.submenu-container a').click( function(){ $('.submenu-container li').removeClass('current-menu-item'); $(this).parent().addClass('current-menu-item'); } ); } );And change this code
<?php wp_nav_menu( array( 'theme_location' => 'submenu', 'container_class' => 'submenu', 'container' => false, 'menu_class' => 'x-nav x-nav-scrollspy', 'link_before' => '<span>', 'link_after' => '</span>' )); ?>to this
<?php wp_nav_menu( array( 'theme_location' => 'submenu', 'container_class' => 'submenu', 'container' => false, 'menu_class' => 'x-nav', 'link_before' => '<span>', 'link_after' => '</span>' )); ?>ScrollSpy is already applied to the primary menu, and it’s responsible for highlighting the primary menu items resetting the highlight of other existing items.
Thanks!
January 11, 2017 at 5:13 pm #1326263
wisdomandcraftParticipantThanks, Rad – I don’t want the primary menu to be the scrollspy menu, though. I want the submenu to do that job. I have a different menu for primary – “main.” How can I turn on the scrollspy/single-page nav, set it to the Submenu, and keep the primary/main nav at the top, x-nav? (submenu is incorrectly being displayed there now).
Thanks,
Chris -
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1321280 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
