Home › Forums › Support › Generate Page Hero inside Content Area This topic has 5 replies, 2 voices, and was last updated 3 years, 10 months ago by Leo. Viewing 6 posts - 1 through 6 (of 6 total) Author Posts June 5, 2019 at 6:58 am #920715 Michael I’m setting a site up using Dispatch from the site library and am keen to move the Page Hero on blog posts into the content (rather than have them full width). I tried using the following code: add_filter( 'generate_page_hero_location', function() { return 'generate_before_content'; } ); But this then breaks the Magazine grid on the front page. How can I only apply it to this specific Header element? June 5, 2019 at 9:00 am #920833 LeoStaff Customer Support Hi there, Give this a shot: add_filter( 'generate_page_hero_location', function() { if ( 10 === $element_id ) { return 'generate_before_content'; } return 'generate_after_header'; } ); Make sure to change 10 to the actual ID of the header element. June 5, 2019 at 6:22 pm #921135 Michael Thanks Leo. I added it but it seemed to stop all the headers appearing June 5, 2019 at 7:24 pm #921148 LeoStaff Customer Support Can you try the updated code? https://generatepress.com/forums/topic/generate-page-hero-inside-content-area/#post-920833 And make sure you change the ID of the element. Let me know ๐ June 3, 2020 at 10:25 pm #1313520 John I’ve tried the same. In my case, with the code above, $element_id seems not to be defined. After some browsing I got the code below to work. add_filter( 'generate_page_hero_location', function( $display, $element_id ) { if ( 10 === $element_id ) { return 'generate_before_content'; } return 'generate_after_header'; }, 10, 2 ); June 4, 2020 at 9:15 am #1314467 LeoStaff Customer Support Glad to hear ๐ Author Posts Viewing 6 posts - 1 through 6 (of 6 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In