Archived topic
Page header Above content area, just on front page
4 replies · Started by blackbird on August 24, 2017
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)
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/
Yeah! :-D
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.
By the way, I love working with Generatepress!
Awesome! Great to hear :)