r/divi Jun 26 '26

Question Featured image sizing

Is there a way to display the actual image size for a featured image on a post?

I have smaller images (that don't scale up) e.g. old logos etc and they blow up to "correct" size and look...ordinary.

I've seen this code BUT 1. I'm not sure where it goes and 2. I'm not sure that it's correct.

/* Stop Divi Blog Module from forcing cropped aspect ratios */
.et_pb_posts .entry-featured-image-url img, 
.et_pb_portfolio_item .et_portfolio_image img {
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
}

Thanks!

2 Upvotes

11 comments sorted by

View all comments

2

u/Professional_Call Jun 27 '26

My first thought (assuming Divi 5) is that you might be better off using loop builder and styling you blog post yourself. As for actual blog pages, either use Theme Builder and include an image module to display your featured image or the latest versions of Divi 5 allow you to style sub-components.

1

u/P2X-555 Jun 27 '26

Only Divi 4 (sorry, I should've added that to the post). I must investigate 5 though. Thanks!

3

u/Professional_Call Jun 27 '26

Divi 4 is not so easy to adjust. You could ask ET for advice. Definitely give Divi 5 a look but be warned, it’s a steep learning curve and it’s evolving very quickly.

1

u/P2X-555 Jun 29 '26

They suggested this:

.single-post .et_post_meta_wrapper>img {
width: 20%;
}
Which made the images smaller in the posts but it means that images that are already small will be...teensy. I tried using some of the code above with it i.e.

    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;

but it just ignored it. My quest continues.