[Resolved] HTML Order for Secdondary Navigation in Header

Home Forums Support [Resolved] HTML Order for Secdondary Navigation in Header

Home Forums Support HTML Order for Secdondary Navigation in Header

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #837991
    Stephane Bergeron

    Hi there,

    I’m looking for whatever hooks I could use to move the Secondary Menu HTML in the header (Navigation Location: Float Right in customizer).

    For now, it appears before the logo in the code and I’d want it after so it behaves better in responsive. Our Primary menu is displayed above header.

    Thanks!

    GeneratePress 2.2.2
    GP Premium 1.7.8
    #838077
    Stephane Bergeron

    I found this :

    add_action( 'generate_after_header_content', 'generate_add_navigation_float_right', 5 );

    So I’m trying this:

    
    add_action( 'after_setup_theme', 'zw3_move_secondary_nav' );
    function zw3_move_secondary_nav() {
    	remove_action( 'generate_after_header_content', 'generate_add_navigation_float_right', 5 );
    	add_action( 'generate_after_header_content', 'generate_add_navigation_float_right', 11 );
    }

    But that is not working. The menu is not removed or added. So I would really appreciate some pointers here.

    Thanks!

    #838145
    David
    Staff
    Customer Support

    Hi there,

    try this:

    add_action( 'after_setup_theme','tu_move_secondary_nav' );
    function tu_move_secondary_nav() {
    	remove_action( 'generate_before_header_content', 'generate_add_secondary_navigation_float_right', 7 );
    	add_action( 'generate_after_header_content', 'generate_add_secondary_navigation_float_right', 7 );
    }
    #838164
    Stephane Bergeron

    Worked great thank you!!!! πŸ™‚

    #838165
    David
    Staff
    Customer Support

    You’re welcome πŸ™‚

    #838166
    Stephane Bergeron

    Are these documented anywhere?

    #838251
    Tom
    Lead Developer
    Lead Developer

    Specific functions/hooks like this aren’t documented anywhere, unfortunately. Honestly, I’m not super happy with the way the navigation is added to hooks currently – it makes them too difficult to move around (as you found out).

    Unfortunately, we aren’t able to improve it without breaking it for people who have moved them around. Hopefully I’m able to come up with something soon πŸ™‚

    #838299
    Stephane Bergeron

    I have confidence in you Tom! πŸ˜‰

    But I do get the importance of backwards compatibility.

    I don’t mind doing it with hooks (I’m used to that with Genesis) but documenting important ones like that would be good. There’s a very useful “Code Snippets” section like that in the Genesis docs that document common hook based mods people often need to do. Something like that here would be great for things that cannot be done in the Customizer or in Elements.

    In this case though, I think an additional option in the Customizer would make sense. I understand why in many cases it makes sense to have the floated right secondary menu above the logo. But not always.

    Thanks again!

    #838935
    Tom
    Lead Developer
    Lead Developer

    Really appreciate the feedback! I’ll see what I can do πŸ™‚

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