Site logo

[Resolved] Secondary menu in the middle of header

Home Forums Support [Resolved] Secondary menu in the middle of header

Home Forums Support Secondary menu in the middle of header

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1839462
    Michael

    Hi

    Am trying to implement and customise Algolia search (truly wonderful) and am getting somewhere with it. I mention this because I have set up a secondary menu which appears below the header with a search box. On the home page it looks fine, on the other pages where I have a custom element that increases the size of the header and displays featured image etc. The secondary menu appears inside of the header?

    I’d love to have the secondary menu below the breadcrumb section ideally. Could this be done with another element and some kind of shortcode?

    #1839640
    David
    Staff
    Customer Support

    Hi there,

    you can unhook the secondary navigation and rehook it eg. this snippet moves it to below the header element:

    add_action( 'after_setup_theme','lh_move_secondary_navigation' );
    function lh_move_secondary_navigation() {
        remove_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 7 );
        add_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 15 );
    }

    This line of the code is where it hooks back in:

    add_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 15 );

    You can change generate_after_header to the same hook you have used for your Bredcrumb – as long as the Priority of 15 in this code is greater than the breadcrumbs priority ( which by default in a Hook element would be 10 ) then it will appear after it.

    #1840037
    Michael

    Hi David,

    Perfect! Thank you ! It’s support like this that keeps me with Generatepress (aside from great product). Just have to work out how to make sure the search headings separate into columns properly now and job done!

    Thanks again…

    #1840284
    David
    Staff
    Customer Support

    Glad to be of help

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