[Resolved] Changing header size depending on page

Home Forums Support Changing header size depending on page

  • This topic has 6 replies, 4 voices, and was last updated 5 months ago by David.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1288227
    Marek

    Hey there,

    Hope you are all well.

    How can I change the size of a header for each page? For instance, on my homepage I would like to have the header nice and big, but on every other page I would like to change the height of the header and change the position of the logo.

    The way it is done here is a good example. If you click on a link outside of the homepage the header collapses.
    https://spreadprivacy.com

    Is there a way to include the menu icon in the header like the website above does?

    Thanks a bunch!

    #1288714
    David
    Staff
    Customer Support

    Hi there,

    my thinking would be this:

    1. Add a Logo to the Site Header as you would want it displayed for the internal ( not home ) pages.
    2. Set the Customizer > Layout > Primary Navigation location to Below Header
    3. Create a Header Element for your Front Page:
    https://docs.generatepress.com/article/header-element-overview/

    For its content you can include the heading and sub-heading.
    Then go to the Site Header tab of the header element where you can select Merge with Content and change the Site Logo if you wish.

    4. Now we need to position the Primary Nav below our Header Element by adding this PHP Snippet to our site:

    add_action( 'after_setup_theme','craig_move_navigation' );
    function craig_move_navigation() {
        remove_action( 'generate_after_header', 'generate_add_navigation_after_header', 5 );
        add_action( 'generate_after_header', 'generate_add_navigation_after_header', 15 );
    }
    #1289204
    James

    I was going to ask a very similar question, but have the header disappear on single post pages, leaving only the nav bar, or a Menu bar.

    James M. Fisher
    www.MiramichiReader.ca
    Read. Review. Repeat.

    #1289250
    Tom
    Lead Developer
    Lead Developer

    Hi James,

    Any chance you can open a new topic? The solution to that should be quite easy with some CSS.

    Thanks!

    #1289252
    James

    Will do, Tom.

    James M. Fisher
    www.MiramichiReader.ca
    Read. Review. Repeat.

    #1292525
    Marek

    Thanks David!

    #1292660
    David
    Staff
    Customer Support
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.