Archived topic
Getting Text and a button into a hero image
8 replies · Started by Eric on August 1, 2022
Hi please see private info, looking to get text and a button into a hero image but can't seem to quite figure it out.
Thank you
Eric
Hi there,
Are you using the block editor by any chance?
It would be very easy to achieve with a block element page hero:
https://docs.generatepress.com/article/block-element-page-hero/
Hi, yes I can do that easily for the image and page title but what about the sub-text and button? How can those be dynamically inserted per page?
I'll try to be more clear.
The page hero on Pages or Posts I want to achieve a custom image, header, sub-text, and buttons (buttons that link to other pages or posts on the site)
I've got the custom image sorted and header...but am failing to see where I can generate custom sub-text independent of the post or page content and custom buttons.
This can be a Page or a Post it doesn't matter, but please let me know how to achieve the sub-text and buttons.
Hi Eric,
but am failing to see where I can generate custom sub-text independent of the post or page content and custom buttons.
You need to create custom fields to store the value of the sub-text and the custom button link for each post.
Then you can use GenerateBlocks's headline block/buttons block to pull the value from those custom fields.
Here's a video should be helpful: https://youtu.be/Ff7ikQ7Yw0w
Does this work on Pages? Or just posts? I can't get it to work on the page.
Also unsure how to style the custom field text and button
Or I can't get it to go underneath the first headline, does this require a custom hook?
Does this work on Pages? Or just posts? I can’t get it to work on the page.
WP custom fields support both posts and pages.
Also unsure how to style the custom field text and button
If you are using GenerateBlocks's headline block or buttons block, there're plenty of built-in options for you to style them.
Or I can’t get it to go underneath the first headline, does this require a custom hook?
I'm not sure what you mean, did you follow the structure I shared in my previous reply?