[Resolved] Second Menu

Home Forums Support [Resolved] Second Menu

Home Forums Support Second Menu

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #253962
    Dries

    Hi Tom,

    I have a question.
    At first a site had only one top menu, now the person wants 2 different menus. They want to be seen as 1 company with 2 subitems. Interior(head) – Wood(sub1) -heating(sub2)

    for the menu changing i used “Menu Swapper” plugin. Now there is a problem with the mobile view on the contact menu subitems(info and contact form)

    Do you have any suggestion or do you know the problem with this plugin?

    Thanks!

    #253990
    Leo
    Staff
    Customer Support

    Hi there,

    Unless I misunderstand what you are after, you should be able to create a second menu/navigation without the plugin.
    Go to Appearance > Menus and create a new menu with the items you want, then click the “Manage Locations” tab and assign the newly created menu to “Secondary Menu”.
    Then you can customize it in Customizer > Layout > Secondary Navigation.

    Let me know if this is what you are looking for šŸ™‚

    #254398
    Dries

    Hi Leo,

    I think you misunderstand :-). For example, I want “Primary menu 1” on Page1 and “Primary menu 2” on Page2.
    So I donĀ“t want 2 menuĀ“s on one page. But two different primary menuĀ“s. With this itĀ“s possible to create 2 sites with different content and menu in one WordPress site.

    I hope this explanation is more clear then my first šŸ™‚

    #254401
    Tom
    Lead Developer
    Lead Developer

    I think Menu Swapper might be your best bet – what exact issues were you having with it?

    Alternatively, you could use a plugin like this and switch out individual menu items: https://en-ca.wordpress.org/plugins/if-menu/

    #254416
    Dries

    Hi Tom,

    IĀ“m using now menu Swapper. The problems i see is: (normal desktop view)No Arrow on the second menu item with submenu items. When you view the site with a mobilephone, there is no dropdown of submenuitems.

    Can I send you the link? For me this is a security threat by publicly saying what you use on that site.

    #254422
    Leo
    Staff
    Customer Support

    You can send the link through the Contact page here: https://generatepress.com/contact/

    #254424
    Tom
    Lead Developer
    Lead Developer

    The next version actually improves how the dropdown arrow is displayed.

    If you’re comfortable with altering core files, open navigation.php and find: https://github.com/tomusborne/generatepress/blob/1.3.41/inc/navigation.php#L196-L226

    And replace it with: https://github.com/tomusborne/generatepress/blob/master/inc/navigation.php#L196-L223

    I’m hoping this change will fix compatibility issues with some plugins like you’re describing.

    #254756
    Dries

    Hi Tom and Leo

    I tried the suggested replacement, but this didnĀ“t fix my problem.

    #254770
    Dries

    ItĀ“s something with the menu swapper I think. When I add the same menu item with dropdown like in the default layout, the problem stays.

    #254893
    Tom
    Lead Developer
    Lead Developer

    Hmm that’s a shame, I had high hopes for that updated code! šŸ™‚

    You may need to settle with a plugin like this: https://en-ca.wordpress.org/plugins/if-menu/

    I’ll take a look at menu swapper and see if I can spot the issue.

    #255022
    Dries

    Hi Tom,

    I tried If-Menu. I canĀ“t accomplish the task with this plugin. You cannot say, hide if you are on this page. šŸ™

    #255040
    Dries

    Hi Tom and Leo,

    I tried “Page Specific Menu Items” okay, plugin works but, yeah but :).

    The image gallery creates a new page, so you have to go there and set the menu for every page šŸ™ ThatĀ“s not so fun. I know people, they forget this things :-).

    Is there another way to do this? for example: http://wordpress.stackexchange.com/questions/150209/how-can-i-display-a-menu-on-certain-pages-only

    Thanks!

    #255191
    Tom
    Lead Developer
    Lead Developer

    Here’s how to do it with Menu Swapper.

    1. Create your new theme locations for your new menus:

    add_action( 'init', 'tu_register_menus' );
    function tu_register_menus() {
        register_nav_menu( 'first-menu', __( 'First Menu' ) );
        register_nav_menu( 'second-menu', __( 'Second Menu' ) );
        register_nav_menu( 'third-menu', __( 'Third Menu' ) );
    }

    Those will allow Menu Swapper to work in the first place.

    2. Then we need to tell our arrows to work in these new theme locations:

    add_filter( 'generate_menu_arrow_theme_locations','tu_gp_dropdown_arrow_locations' );
    function tu_gp_dropdown_arrow_locations( $theme_locations ) {
        $theme_locations[] = 'first-menu';
        $theme_locations[] = 'second-menu';
        $theme_locations[] = 'third-menu';
    
        return $theme_locations;
    }

    Tested and working šŸ™‚

    #255204
    Dries

    Hi Tom, This need to be done in the GP Navigation.php? or do I add this in a GP hook?

    What with future updates?

    Thanks!

    #255205
    Tom
    Lead Developer
    Lead Developer
Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.