Site logo

Archived topic

missing secondary menu

7 replies · Started by Hans on January 12, 2020

Viewing posts 1–8 of 8

I want to show the secondary menu above the footer. I use this code (from the forum):

add_action( 'after_setup_theme', 'lh_move_secondary_nav' );
function lh_move_secondary_nav() {
    remove_action( 'generate_before_header', 'generate_add_secondary_navigation_before_header', 7 );
    add_action( 'generate_after_footer_widgets', 'generate_add_secondary_navigation_before_header', 7 );
}

These are the customizer settings.
Settings
The menu bar does not appear!
Where might be the erroer?

Hi there,

that Hook only exists if you have Footer Widgets being displayed.
You can use the generate_after_main_content instead.

Hi David,

following your advice I used this code:

add_action( 'after_setup_theme', 'lh_move_secondary_nav' );
function lh_move_secondary_nav() {
    remove_action( 'generate_before_header', 'generate_add_secondary_navigation_before_header', 7 );
    add_action( 'generate_after_main_content', 'generate_add_secondary_navigation_after_main_content', 7 );
}

Unfortunately the menu is still missing.

Try:

add_action( 'after_setup_theme', 'lh_move_secondary_nav' );
function lh_move_secondary_nav() {
    remove_action( 'generate_before_header', 'generate_add_secondary_navigation_before_header', 7 );
    add_action( 'generate_after_main_content', 'generate_add_secondary_navigation_before_header', 7 );
}

Hi David,

I used your code. The image shows the result.

Secondray menu show up floating

Let's try this, instead:

add_action( 'after_setup_theme', function() {
    remove_action( 'generate_before_header', 'generate_add_secondary_navigation_before_header', 7 );
    add_action( 'generate_footer', 'generate_add_secondary_navigation_before_header', 5 );
} );

Let me know :)

Thanks, it works!

You're welcome :)

This archived topic is closed to new replies.