Site logo

Archived topic

Move Secondary Navigation before footer

7 replies · Started by Chitika on October 24, 2020

Viewing posts 1–8 of 8

Hello.
I'm trying to add this code -

add_action( 'after_setup_theme', function() {
    remove_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 5 );
    add_action( 'generate_before_footer', 'generate_add_secondary_navigation_after_header', 1 );
});

But the secondary navigation appears both above and below.
How to make it appear only once.
I removed the code btw,

Hi there,

try this instead.

1. Set the Customizer > Layout > Secondary Navigation --> Location to No Navigation
2. Add this PHP Snippet:

add_action( 'generate_before_footer', 'generate_secondary_navigation_position', 1 );

Thanks @David. That worked perfectly.

You're welcome

Hi David, just following on from this, I'd like to position the secondary menu in between the footer widgets and the footer bar. Could you please provide an updated snippet? Thanks!

So this line:

add_action( 'generate_before_footer', 'generate_secondary_navigation_position', 1 );

becomes:

add_action( 'generate_after_footer_widgets', 'generate_secondary_navigation_position', 1 );

Thank you David...

You're welcome

This archived topic is closed to new replies.