[Resolved] Page Header will not move to "inside content" on blog page

Home Forums Support [Resolved] Page Header will not move to "inside content" on blog page

Home Forums Support Page Header will not move to "inside content" on blog page

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #494908
    Kathy

    New to GP & GP-pro – all up-to-date versions.
    I have a static front page and the blog is on a separate page.
    I have a page header that appears as wanted on SINGLE posts – in the content area next to sidebar, however, I need the same page header to appear in the same place, in content area next to sidebar, on the blog page – but no matter what I set, it still appears at the top, above both the content area AND the side bar on the blog page.

    Page Header settings:
    Global Locations:
    Posts Page = my blog page
    Posts = my blog page

    Settings in header:
    container = contained
    inner = contained

    In the customizer: Layout > Page Header:
    Single post location = Inside Content Area
    This works as expected and changes as expected if I switch it to outside

    Page Header Location = Inside Content Area
    This does not work as expected. The header is at top, across both content and sidebar.
    SWITCHING back and forth between inside/outside does not make any change at all. it always remains above the content & sidebar.

    Am I missing something??
    This is a fresh install, no added CSS of any kind, blog page and blog entries are all standard WP editor created; using standard GP theme template; nothing has been added to functions.php; no cache running

    thanks
    – kathy

    GeneratePress 2.0.2
    GP Premium 1.5.6
    #495419
    Tom
    Lead Developer
    Lead Developer

    Hi Kathy,

    We’re actually working towards deprecated the Customize > Layout > Page Header section – those options currently only apply to single posts and pages.

    Instead, we’ll be adding a location option to the actual page header settings.

    For now, try this PHP:

    add_action( 'wp', 'tu_move_page_header', 20 );
    function tu_move_page_header() {
        if ( ! function_exists( 'generate_get_blog_page_header' ) ) {
            return;
        }
    
        if ( is_singular() || generate_get_blog_page_header() ) {
            remove_action( 'generate_after_header', 'generate_page_header' );
            add_action( 'generate_before_content', 'generate_page_header' );
        }
    }

    Let me know if that works or not ๐Ÿ™‚

    #495544
    Kathy

    Looking forward to location options in the page header section – until then, this WORKS!
    Thanks!

    #495807
    Tom
    Lead Developer
    Lead Developer
    #517528
    John

    Hello, thank you for the above 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.

    Thanks John

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