[Support request] Drop down menu

Home Forums Support [Support request] Drop down menu

Home Forums Support Drop down menu

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #1999320
    Loïc

    I need the top red menu to have drop down but I saw in the doc its only available for primary menu. Do I need to exchange primary and secondary menus for this to work ?

    #1999370
    Leo
    Staff
    Customer Support

    Hi there,

    Do I need to exchange primary and secondary menus for this to work ?

    This method would work if you don’t plan on using the sticky navigation would display the primary menu.

    We also can provide a snippet that moves secondary navigation to the top.

    Let me know 🙂

    #1999811
    Loïc

    Please send me that snippet – do I need to use a plugin to have it worked ?

    #1999826
    David
    Staff
    Customer Support

    Hi there,

    To make this change, you need to consider how the theme works and your current site structure:

    1. Drop Down Menus are available for both the Theme Navs ie. Primary and Secondary Navigation.
    2. Only the Theme Navs have Mobile responsive controls.

    So if you want to have a sub menu you need to use a theme nav. And if you swap the Primary Nav with the Top bar, then what happens to that on mobile ?

    #1999909
    Loïc

    What I need is that red menu at the top that remains sticky with drop down options … Is it possible ?

    #1999931
    David
    Staff
    Customer Support

    No – you can’t add a drop down to the Top Bar.
    You would have to replace it with the Primary Navigation but then you have to consider what happens with your current primary nav – as that will no longer be Mobile responsive.

    #2000083
    Loïc

    Can I put the red menu in the header below the grey menu in the top bar and have the drop down ? The grey menu is ony links with no subitems …

    #2000480
    David
    Staff
    Customer Support

    And what happens to the Grey Menu on Mobile ? As it won’t have the hamburger menu if you swap it.

    #2000482
    Loïc

    Right … Its kind of complicated. What do you advise ?

    #2000917
    Elvin
    Staff
    Customer Support

    Hi Loic,

    If I may suggest, I think you can use the secondary navigation.

    IF the concern is it being sticky, consider doing what was done in this topic: (involves custom script)
    https://generatepress.com/forums/topic/sticky-second-navigation/

    It’s a bit tedious but consider reading the whole discussion as the script evolved but it works for the second nav. 😀

    A wise man once said:
    "Have you cleared your cache?"

    #2031830
    Loïc

    Hello. I dont understand how to proceed … I want to have some dropdown for the first menu (in red) I can arrange for not having second menu (in grey) on mobile but whatever I try I cant get any dropdown … Which one should be primary and which one secondary – how do I place them ? using GP dashboard or as widgets or elements ? Its not clear at all.

    I have looked at the demo site of yours (Elvin) but there is only one nav bat at the top …

    Please advise

    #2031903
    David
    Staff
    Customer Support

    Unless you STOP using the Secondary Navigation in the sidebar the only other option is to set the location of the Menu with Drop Downs in the Primary Navigation.

    #2031973
    Loïc

    It is what I tried to do but I cant put it with dropdown in the top red bar.

    The menu in the sidebar are conditional menus, the secondary menu shows up when there is no submenu associated.

    Thanks,

    #2032949
    David
    Staff
    Customer Support

    It would require changing several things to create that layout. Some of which we would need to do in stages.

    First it so swap the location of the Top Bar and the Primary Navigation.
    To do that add this PHP Snippet to your site:

    // Primary navigation above top bar
    add_action( 'after_setup_theme','db_primary_nav_above_top_bar' );
    function db_primary_nav_above_top_bar() {
        remove_action( 'generate_before_header', 'generate_add_navigation_before_header', 5 );
        add_action( 'generate_before_header', 'generate_add_navigation_before_header', 4 );
    }

    this doc explains adding PHP:
    https://docs.generatepress.com/article/adding-php/

    Once that is added we can go through the menus, colors and the social icons.

    #2033565
    Loïc

    I entered the snippet but the primary navigation did not move to the top bar ….

Viewing 15 posts - 1 through 15 (of 24 total)
  • You must be logged in to reply to this topic.