Archived topic
Page Header Location - Inside Content Area
2 replies · Started by John on March 12, 2018
Hello, I understand there will be an update soon to so that the Page Header will appear inside Content Area on Pages and Post (Not just single pages/posts.
thank you for the explanation re single posts/ pages.
I have the same issue with the Page Header Location not appearing inside the Content Area on my Shop category pages. So it appears above both Products and Sidebar. Looking at the above PHP fix for Blog Post page. Sorry to ask, but are you able to help with a fix for Pages? Would really help.
https://generatepress.com/forums/topic/page-header-will-not-move-to-inside-content-on-blog-page/
Sorry - I accidentally posted that mid writing. Hope it makes sense. I added my first post to the blog post header page thread. (Link in above post) But then saw it was marked as resolved.So created this post here.
Thanks
John
Hi John,
The default placement of Page Headers will always be below the header, as they are "Page Headers".
However, the code on that page should work for you, we just have to tweak the conditional:
add_action( 'wp', 'tu_move_page_header', 20 );
function tu_move_page_header() {
if ( ! function_exists( 'generate_get_blog_page_header' ) ) {
return;
}
if ( function_exists( 'is_product_category' ) && is_product_category() ) {
remove_action( 'generate_after_header', 'generate_page_header' );
add_action( 'generate_before_content', 'generate_page_header' );
}
}
Hope this helps :)