Archived topic
Page Hero on Homepage
9 replies · Started by Marius on November 17, 2022
Hello,
I want to put a Page Hero (simply a big picture) on the Homepage.
But after reading the docs, I am confused how to do this.
With this: https://docs.generatepress.com/article/block-element-page-hero/
or with this: https://docs.generatepress.com/article/how-to-create-a-page-hero/
Hi there,
Any chance you can link us to the page in question?
You can use the private information field:
https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Let me know :)
Hello Leo,
this Page is not public yet.
But which of the two Methods should we use, to make such a Hero?
Hi Sonja,
The header element method is out of date, you should use the block element - page hero.
https://docs.generatepress.com/article/block-element-page-hero/
Hi Ying,
with Header Element Method, you mean this, right? : https://docs.generatepress.com/article/how-to-create-a-page-hero/
If this is out of date, then this should be mentioned in the docs. Otherwise this will lead to confusion.
If it's just a picture (without any text content) then have you considered just using the featured image instead?
It should be a Hero with full witdh.
I would say the easiest method would be to create a block element hook:
https://docs.generatepress.com/article/block-element-hook/
Then add the image using the WP core image block or GP's image block - doesn't matter.
Then display it using the after_header hook.
Hmm, and why should I not use a Page Hero? I thought that this would be a textbook example for a page hero?
Page heros usually have text content on top of the image.
This would make the image a background image that isn't responsive.
If you simply want an image then can you try my solution first? In that case, the image would be a static image which would be responsive.