Archived topic
GP Page Headers position
3 replies · Started by David on July 22, 2018
Hello to the forum!
Just a simple question: I have set up correctly Page Headers to show in their proper category archive pages.
All works well. But I need to place "Page Header" in a different position, as shown below, in place of category's title (hidden via CSS). attached screenshot
Thanks a lot,
David
Hi there,
Looks like we would need to move the page header inside the content container.
Can you try this PHP snippet:
add_action( 'wp', 'lh_move_category_page_header', 20 );
function lh_move_category_page_header() {
if ( ! function_exists( 'generate_get_blog_page_header' ) ) {
return;
}
if ( is_category() || generate_get_blog_page_header() ) {
remove_action( 'generate_after_header', 'generate_page_header' );
add_action( 'generate_before_main_content', 'generate_page_header' );
}
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Awesome!
Works really nice.
D.
No problem :)