Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Secondary Navigation Menu Before Header

  • Hi,
    I’m trying to add a secondary navigation menu to the top of a website (before the header) using the instructions in this post https://generatepress.com/forums/topic/i-want-to-have-a-second-menu-on-certain-pages-what-is-the-best-way/, and I’m not able to make it work. I have added it as a Hook Element using the generate_before_header with a priority of 15. Under Display Rules, I have chosen Entire Site.

    Again, I’m using this code as suggested in the post:

    <div class="second-nav">
    	<?php 
    	if ( function_exists( 'generate_secondary_navigation_position' ) ) {
    		generate_secondary_navigation_position();
    	}
    	?>	
    </div>

    As you can see, the menu appears twice. Can you tell me what I’m doing wrong? Also, is there a way to align that secondary menu to the left before the header?

  • Hi there,

    Are you trying to add the secondary nav to the entire site or specific pages?

    Let me know 🙂

  • Hi, Ying!
    Ultimately, I’d like to add it throughout the website so I chose Entire Site. I had asked a question a few weeks ago (https://generate.support/topic/is-there-a-way-to-achieve-this-look-with-gp-gb/) about a top bar effect that was similar to a tabbed look, but I think it would be easier to achieve with this menu.
    Thanks for your help!

  • Ultimately, I’d like to add it throughout the website so I chose Entire Site.

    If this is the case, you do not need to add the code, just set the secondary navigation location to above header at customizer > layout > secondary navigation, which it seems you have done.

    So remove the hook element should fix the issue.

  • This is perfect so far. Thanks so much. Now, is there a way for me to get this menu left aligned?
    Thanks!

  • Can I see your site?

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