Site logo

[Resolved] single.php – move class “page header” above class “site-main”

Home Forums Support [Resolved] single.php – move class “page header” above class “site-main”

Home Forums Support single.php – move class “page header” above class “site-main”

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2506050
    Chad Biggs

    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

    #2506196
    Ying
    Staff
    Customer Support

    Hi there,

    Can you link us to one of your posts?

    #2506245
    Chad Biggs

    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/

    #2506265
    Ying
    Staff
    Customer Support

    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!

    #2506275
    Chad Biggs

    The image is from the browser inspector. I made changes there to make sure I can do what I need.

    #2506308
    Ying
    Staff
    Customer Support

    Oh, I see, sorry for the misunderstanding.

    So the page you want to change is the archive page not the single post page?

    #2506344
    Chad Biggs

    Correct.

    #2506380
    Ying
    Staff
    Customer Support

    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' ); ?>
    #2506522
    Chad Biggs

    Perfect. Thank you.

    #2506570
    Ying
    Staff
    Customer Support

    You are welcome   🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.