Site logo

Archived topic

Styling on my hook on (`after_header)

4 replies · Started by Huseyin on May 4, 2020

Viewing posts 1–5 of 5

Hi there,

What issues are you having?

There isn't anything built-in GP specifically for that so you would need to custom code it.

Another option is to use the secondary navigation:
https://docs.generatepress.com/article/secondary-navigation-layout-overview/

Then we can move it below the page hero with this PHP snippet:

add_action( 'after_setup_theme','craig_move_navigation' );
function craig_move_navigation() {
    remove_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 5 );
    add_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 15 );
}

PERFECT THANKS

No problem :)

Can you try this instead:

add_action( 'wp','craig_move_navigation' );
function craig_move_navigation() {
    remove_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 5 );
    add_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 15 );
}
This archived topic is closed to new replies.