Archived topic
padding on featured image
7 replies · Started by orlaith on January 9, 2023
Hi, how can I adjust the padding on a featured image it is attached to my page hero and I want space across all devices. Also, can I set my page hero hook as the featured image for all pages except homepage? Thanks
Hi Orlaith,
For reference, can you provide the link to where we can see the Page Hero?
You may use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Also, to answer your question, yes it's possible. However, by default, only Posts have featured images. Other pages don't have one. You would need custom code or a third party plugin to enable the "Featured image" feature on other pages.
Hi Fernando, sure I've added the page. I would like to have a featured image though to show up in the SERPs, so that cannot be done natively within GP pages only posts?
Hi there,
on the linked page of your site, i see the Featured image below the hero image.
Are you wanting to change how that featured image is displayed ?
Hey David, yes I would like to add about 80px padding on the top and bottom.
Try this CSS:
.featured-image {
padding: 80px 0;
}
and if you want to force the image to fill the width of your content container add this too:
.featured-image img {
width: 100%;
}
Thanks David. For part 2 of my question there I want a featured image for each page to show up in the SERPs. Is it possible to set the page header element image as the featured image?
Does setting the Dynamic Background Image source of your Container Block for the Page Hero to Featured image work?
Reference: https://docs.generatepress.com/article/dynamic-data/#dynamic-background