[Resolved] Duplicate Menu

Home Forums Support [Resolved] Duplicate Menu

Home Forums Support Duplicate Menu

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #251554
    Andy

    Hi Tom,

    I’m using some code you had posted on the forums (slightly edited) to make the navigation display below the page header:

    add_action( 'wp','tu_move_nav_inside_page_header' );
    function tu_move_nav_inside_page_header()
    {
    	$page_header_content = get_post_meta( get_the_ID(), '_meta-generate-page-header-content', true );
    	if ( '' !== $page_header_content ) {
    		remove_action( 'generate_after_header_content', 'generate_add_navigation_after_header', 5 );
    		add_action( 'generate_after_page_header', 'generate_add_navigation_after_header', 5 );
    	}
    }

    It works but it also leaves a copy of the navigation in its original position. I could try hiding this with CSS but is there a better way using the action hook you provided?

    You can see the site here: http://tinyurl.com/h7943yu

    #251633
    Tom
    Lead Developer
    Lead Developer

    That code assumes your navigation is set to “Float right”.

    As yours is set to below the header, you would do this: https://generatepress.com/forums/topic/different-headers-with-menu-under-picture/#post-246161

    #251708
    Andy

    Sorry I realised I while ago what the code should have been and then forgot to change it in the functions file.

    Thanks Tom.

    #251753
    Tom
    Lead Developer
    Lead Developer

    No problem 🙂

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