[Resolved] How to show Header element on the homepage as well as blog posts?

Home Forums Support [Resolved] How to show Header element on the homepage as well as blog posts?

Home Forums Support How to show Header element on the homepage as well as blog posts?

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1461450
    Heath

    I would like my Header element to show on the home page and at the top of my blog posts if possible. I still would like to show the featured image of the post as well. Is this possible?

    #1461455
    Leo
    Staff
    Customer Support

    Hi there,

    The best practice I would recommend is to create 2 separate header elements for the posts page and single posts:

    – Posts page: A header element with a custom image as the background image option as WordPress doesn’t allow a featured image on posts/archives pages.

    – Single posts: A header with featured images as the background image option so the background image would be dynamic.

    https://docs.generatepress.com/article/how-to-create-a-page-hero/#step-2-choose-a-background

    Let me know if this helps πŸ™‚

    #1461505
    Heath

    I know youve included the link but I’m not able to get this to actually show in the posts.

    #1461526
    Elvin
    Staff
    Customer Support

    Hi Heath,

    You need to set the display rules. The display rules location will define where the header element will display. πŸ™‚

    #1461550
    Heath

    I did that but nothing was showing.

    #1461585
    Elvin
    Staff
    Customer Support

    I’ve inspected the site and it’s actually there but it isn’t visible because the element height was 0.

    We’re close. We just to make it visible by adding padding top or bottom on the Header element.

    Here’s a demo video you can copy to make it appear. πŸ™‚
    https://share.getcloudapp.com/yAul8LQ0

    Adding {{post.title}} is optional. I just added it to show more possibilities with the element. πŸ˜€

    #1461601
    Heath

    Thanks. This worked. The only other thing is how do I get the text to be centered?

    #1461607
    Elvin
    Staff
    Customer Support

    Nice one!

    The only other thing is how do I get the text to be centered?

    One the same tab where you set the padding, you should be able to see a “Horizontal Alignment” option. Just set it to “Center”.
    https://share.getcloudapp.com/wbuP1kRB

    #1462011
    Heath

    I’ve done that as well but the text still isn’t centered. Its to the left of the screen.

    #1462447
    Leo
    Staff
    Customer Support

    Is there a specific page or post I should be looking at?

    The home page is centered:
    https://www.screencast.com/t/TX5MA3FO

    So are the single posts:
    https://www.screencast.com/t/jqcCFKPpJzn

    #1462644
    Heath

    Maybe its just mobile where I see the issue. It is definitely not centered on my mobile device.

    #1462649
    Heath

    And it is the posts that I am referring to.

    #1462684
    Leo
    Staff
    Customer Support

    You have uneven left and right padding set on mobile:
    https://www.screencast.com/t/jqYyFt59TE4E

    You can adjust the setting with the mobile toggle activated:
    https://docs.generatepress.com/article/header-element-overview/#padding

    #1462823
    Heath

    Worked like a charm.

    #1462826
    Leo
    Staff
    Customer Support

    Glad to hear πŸ™‚

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