Black Friday Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] Page header Above content area, just on front page

Home Forums Support Page header Above content area, just on front page

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #372613
    blackbird

    Hi, I have not found the answer to this:

    I have Page headers set to “Inside Content Area” for my Pages. And I use features images on most of them, no problem. But on our static Front page only I would like to change that location to “Above content area”. Is that easily done? How?

    (I want to show a 100% content wide slide show between the header sektion and content, you know like everyone has done it for years… I have put the shortcode in a Page header and it is working fine, except I do not want it small in my content area next to the sidebar, it must span above both content and sidebar.)

    (I am on 1.4.2)

    GeneratePress 1.4
    #372721
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Try this:

    add_filter( 'generate_page_header_location', 'tu_dynamic_page_header_location' );
    function tu_dynamic_page_header_location( $location ) {
        if ( is_front_page() ) {
            return 'above-content';
        }
    
        return $location;
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    #373221
    blackbird

    Yeah! 😀
    Oh how simple when you know how to do it, I tried some hooks and different heading solutions that did not do it, but I am new to PHP. This works perfect for just changing one page.

    Thank you so much, I learned something new in the process and the Code snippet was also a new nice plugin.

    Solved.

    #373222
    blackbird

    By the way, I love working with Generatepress!

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