Site logo

Archived topic

Centered main content with skewed sidebar

5 replies · Started by Shreedhan on May 31, 2018

Viewing posts 1–6 of 6

Hi there,

Looks like we need to move the page header inside the content.

Can you try this snippet first?

add_action( 'wp', 'tu_move_page_header', 20 );
function tu_move_page_header() {
    if ( ! function_exists( 'generate_get_blog_page_header' ) ) {
        return;
    }

    if ( is_home() || 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/

Done, the header is now within the left hand column on the homepage. The single-post page is still the same for the time being.

Cool thanks. That gets me pretty much there, just need to fine tune the margin now like you say.

Thanks!

No problem!

This archived topic is closed to new replies.