[Resolved] GP Page Headers position

Home Forums Support [Resolved] GP Page Headers position

Home Forums Support GP Page Headers position

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #629942
    David

    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

    #630196
    Leo
    Staff
    Customer Support

    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/

    #630335
    David

    Awesome!
    Works really nice.
    D.

    #630799
    Leo
    Staff
    Customer Support

    No problem 🙂

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