Archived topic
single.php - move class "page header" above class "site-main"
9 replies · Started by Chad Biggs on January 23, 2023
Can you tell me which page/how I need to modify to move div class "page-header" above div class "site-main" on single post as seen in image below?
Thank you

Hi there,
Can you link us to one of your posts?
Actually it is the archives page where I need the change. I am using single.php to fill the content-area and need to move 'page-header' above 'site-main'. https://blestrecipes.com/dish_type/dinner/
The link you provided is an archive link, but single.php is for single posts.
But neither of the archive nor the single posts has the structure your screenshot shows.
Can you check and link me to the post where I can see the same structure?
let me know!
The image is from the browser inspector. I made changes there to make sure I can do what I need.
Oh, I see, sorry for the misunderstanding.
So the page you want to change is the archive page not the single post page?
Correct.
1. Take a copy of archive.php from the parent theme to your child theme folder.
2. These lines of code are the page header: https://github.com/tomusborne/generatepress/blob/master/archive.php#L27-L34
You can cut and paste them before this line: https://github.com/tomusborne/generatepress/blob/master/archive.php#L15
Please be noted, the code needs to be wrapped with <? and ?> like this:
<? /**
* generate_archive_title hook.
*
* @since 0.1
*
* @hooked generate_archive_title - 10
*/
do_action( 'generate_archive_title' ); ?>
Perfect. Thank you.
You are welcome :)