- This topic has 31 replies, 5 voices, and was last updated 4 years, 1 month ago by
David.
-
AuthorPosts
-
January 12, 2022 at 5:19 am #2077783
David
StaffCustomer SupportAs i mentioned above it will require some CSS to force the featured image to 100% width.
Try this:.featured-image.page-header-image { max-width: unset; } .featured-image.page-header-image img { width: 100%; }January 12, 2022 at 6:34 am #2077859_blank
Thanks, added this to Customize > Additional CSS.
It did force the image full-width, but I thought we were looking into why this wasn’t happening in the first place? I made several huge images to test, 10k, 50k px etc., and no matter the width, they never extended to the sides. I prefer not to clutter with CSS if possible so if there’s a bug or something with featured images it’d be great to look into that.
January 12, 2022 at 7:52 am #2078101David
StaffCustomer SupportUnless disabled there are default functions in WP that will limit the max width of an image to 2560px. Even if you upload a 10000px wide image it will resize it to 2560px.
Featured images are controlled by the Customizer > Layout > Blog –> Featured image settings and for that to work correctly they have to be within a grid-container.
Which is why they require CSS to make them fill the width of any screensize.
January 12, 2022 at 7:56 am #2078108_blank
Cool, thanks for explaining, it’s really helpful to actually understand the reasons for certain behaviour! 🙂
January 12, 2022 at 8:01 am #2078119David
StaffCustomer SupportFor sure – glad to be of help!
January 31, 2022 at 9:06 am #2100309_blank
Hi there,
Unfortunately, while we solved this for Pages, we now have the same issues for Posts of featured image not sitting flush to top of the page / displaying full width.
For full width we tried below but didn’t work:
.featured-image.post-header-image { max-width: unset; } .featured-image.post-header-image img { width: 100%; }For sitting flush to top, we’re not sure how to solve it, as sitting flush is the default behaviour for ‘Default’ content container layout Pages…so why not Posts?
Thanks!
January 31, 2022 at 11:12 am #2100457Ying
StaffCustomer SupportHi there,
Can you link us to your site again? As the topic is marked as resolved your site info has been erased.
Thanks!
February 1, 2022 at 2:56 am #2101094_blank
In private, thanks.
February 1, 2022 at 11:25 am #2101768Ying
StaffCustomer SupportPosts have different structure than pages, so the CSS won’t work for posts.
In David’s reply here: https://generatepress.com/forums/topic/top-menu-covering-featured-image-content-blocks/#post-2076468
He suggested using a page hero to replace the posts featured image, I would recommend doing this as well.
Give block element – page hero a try for posts:
https://docs.generatepress.com/article/block-element-page-hero/February 8, 2022 at 6:35 am #2109370_blank
Hi there,
Is there a CSS that would work for Posts?
Shouldn’t featured images just work as standard? It’s an essential part of WordPress and shouldn’t really require a workaround.
Many thanks
February 8, 2022 at 7:26 am #2109427David
StaffCustomer SupportChange the other CSS for this:
.featured-image.post-header-image, .featured-image.page-header-image-single { max-width: unset; } .featured-image.post-header-image img, .featured-image.page-header-image-single img { width: 100%; }February 8, 2022 at 10:23 am #2109799_blank
Didn’t work; still neither full width nor flush to top, as per original example.
February 8, 2022 at 11:13 am #2109851Ying
StaffCustomer SupportGo to customizer > layout > blog, set the
featured image locationforpoststoabove content area.February 9, 2022 at 5:06 am #2110563_blank
We don’t see that option in the main customiser, or the post layout section?
February 9, 2022 at 6:22 am #2110658David
StaffCustomer SupportYou need to enable the Blog Module in Appearance > GeneratePress
Then follow Yings steps: -
AuthorPosts
- You must be logged in to reply to this topic.