Celebrating 7 Years! Get up to $30 off GeneratePress Premium!

[Support request] Page Header Location – Inside Content Area

Home Forums Support [Support request] Page Header Location – Inside Content Area

Home Forums Support Page Header Location – Inside Content Area

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #517534
    John

    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/

    #517535
    John

    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

    #517990
    Tom
    Lead Developer
    Lead Developer

    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 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.