Subscribe On YouTube

Join other subscribers and enjoy other Divi video tutorials!

How To Change the Divi Blog Image Aspect Ratio – Make Featured Images Square or Any Size

Nelson Miller Profile Orange
In this tutorial, I'm going to share some handy CSS snippets to change the Divi blog module featured image aspect ratio. This will be fun!

▶️ Please watch the video above to get all the exciting details! 👆

NOTE: You might want to also check out a similar but very different tutorial called How To Stop Divi Image Crop. That one actually make the blog use the original uploaded image aspect ratio instead.

How To Stop Image Crop In The Divi Blog Portfolio Gallery Modules Tutorial by Pee Aye Creative
change the Divi blog image aspect ratio square

Where To Paste The CSS Code

1. Divi Assistant
If you are using our Divi Assistant plugin, simply paste the code in the CSS tab in the custom code window in the Divi Visual Builder.

2. Child Theme
If you are using a child theme, paste this code into the style.css file. If you don't have a child theme, you can generate a child theme directly on your site or download our free child theme.

3. Divi Theme Options Integration
Otherwise, paste this code in your Divi>Theme Options>Custom CSS code box.

If you need help understanding where to paste the code, please check out our complete guide about where to add custom code In Divi.

change the Divi blog image aspect ratio square
/*blog image aspect ratio square 1:1*/

.pa-blog-image-1-1 .entry-featured-image-url {
  padding-top: 100%;
  display: block;
}

.pa-blog-image-1-1 .entry-featured-image-url img {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  object-fit: cover;
}
change the Divi blog image aspect ratio square
/*blog image aspect ratio landscape 16:9*/

.pa-blog-image-16-9 .entry-featured-image-url {
  padding-top: 56.25%;
  display: block;
}

.pa-blog-image-16-9 .entry-featured-image-url img {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  object-fit: cover;
}
change the Divi blog image aspect ratio square
/*blog image aspect ratio landscape 4:3*/

.pa-blog-image-4-3 .entry-featured-image-url {
  padding-top: 75%;
  display: block;
}

.pa-blog-image-4-3 .entry-featured-image-url img {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  object-fit: cover;
}
change the Divi blog image aspect ratio square
/*blog image aspect ratio landscape 3:2*/

.pa-blog-image-3-2 .entry-featured-image-url {
  padding-top: 66.66%;
  display: block;
}

.pa-blog-image-3-2 .entry-featured-image-url img {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  object-fit: cover;
}
change the Divi blog image aspect ratio square
/*blog image aspect ratio portrait 9:16*/

.pa-blog-image-9-16 .entry-featured-image-url {
  padding-top: 177.77%;
  display: block;
}

.pa-blog-image-9-16 .entry-featured-image-url img {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  object-fit: cover;
}
change the Divi blog image aspect ratio square
/*blog image aspect ratio portrait 3:4*/

.pa-blog-image-3-4 .entry-featured-image-url {
  padding-top: 133.33%;
  display: block;
}

.pa-blog-image-3-4 .entry-featured-image-url img {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  object-fit: cover;
}
change the Divi blog image aspect ratio square
/*blog image aspect ratio portrait 2:3*/

.pa-blog-image-2-3 .entry-featured-image-url {
  padding-top: 150%;
  display: block;
}

.pa-blog-image-2-3 .entry-featured-image-url img {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  object-fit: cover;
}

Subscribe For More Things Like This!

At the start of each month, we send out a recap newsletter from the month before with family news, Divi news, our latest tutorials, and product news. Occasionally, if the news is too exciting to wait, we will send out another email separate from the monthly newsletter. That’s what you get when you subscribe, and of course you can unsubscribe if you are no longer interested!

Blog Post Optin

Leave A Response!

By commenting you agree to our Blog & YouTube Comments Policy

86 Comments

Comments By Members

  1. John Farrell <span class="comment-author-role-label"><a href="https://wordpress-292293-1617718.cloudwaysapps.com/product/divi-adventure-club/" class="comment-author-role-link" rel="external nofollow" target="_blank">Divi Adventure Club Member</a></span>

    Haha! I knew if I looked long enough through your notes I’d find what I was looking for. I still say you should incorporate all of these style settings into one Ultimate Divi Blog Module (you can have the name if it’s not already being used… 😉 ) Thank you for taking the time to publish these blog articles for us!

    John F.

    Reply
  2. Spencer Taylor <span class="comment-author-role-label"><a href="https://wordpress-292293-1617718.cloudwaysapps.com/product/divi-adventure-club/" class="comment-author-role-link" rel="external nofollow" target="_blank">Divi Adventure Club Member</a></span>

    This tutorial has saved my bacon a couple of times! I will never know why Divi doesn’t include these options in the blog module, but this post is extremely beneficial. Thank you!

    Reply

Comments By Others

  1. Hemant Gaba

    Hi Maudy!

    Can you please share the URL of the page to check further?

    Reply
  2. Hemant Gaba

    Hi Martin!

    Could you please share the URL where you are facing this issue for me to investigate further?

    Reply
  3. Martin

    The weird thing is that if I add the Custom Divi Blog Module on the same page where the Default Blog Module is loaded, the problem goes away.

    It looks like the Custom Divi Blog Module plugin from this website is missing something that is loaded when the default Divi Blog Module is used.

    I’m guessing the Divi Blog Module got updated on the way and these changes are not reflected in the Custom Divi Blog Module. For example here is 1 difference I could find in a minute.

    ‘border_radii’ => ‘%%order_class%% .et_pb_post .entry-featured-image-url img, %%order_class%% .et_pb_post .et_pb_slides, %%order_class%% .et_pb_post .et_pb_video_overlay’,
    ‘border_styles’ => ‘%%order_class%% .et_pb_post .entry-featured-image-url img, %%order_class%% .et_pb_post .et_pb_slides, %%order_class%% .et_pb_post .et_pb_video_overlay’,

    vs

    ‘border_radii’ => ‘%%order_class%% .et_pb_post .entry-featured-image-url, %%order_class%% .et_pb_post .et_pb_slides, %%order_class%% .et_pb_post .et_pb_video_overlay’,
    ‘border_styles’ => ‘%%order_class%% .et_pb_post .entry-featured-image-url, %%order_class%% .et_pb_post .et_pb_slides, %%order_class%% .et_pb_post .et_pb_video_overlay’,

    Reply
  4. Alexan

    I have a section of blogs with square images but that should only be in “the latest” section. The blog modules below that section are the images I’m trying to crop. On desktop, they show as squares (I don’t know why), but I’m wanting them to be 3:4 on mobile. On my end, on mobile, the first module that I tested this on is not cropped correctly to be 3:4. Are you seeing it on mobile?

    Reply
  5. Alexan

    I see the step I missed now, oh my gosh 🤦🏻‍♀️ I tested the code on one blog module and the image is cropped now, but not correctly. It’s extremely tall and very skinny (again, using the 3:4 code). I have no idea where I’m going wrong here! 😭 Including my URL so you can see what I mean!

    Reply
  6. Hemant Gaba

    Hi Mary Pope-Handy!

    Could you please share the URL where you are facing this issue for me to investigate further?

    Reply
  7. Hemant Gaba

    Hey Amany!

    Thank you very much! The pink part in the code is the custom Class. You need to add the whole code (pink + black). We will consider adding the code in more simpler way.

    Reply
  8. Nelson Lee Miller (aka The Divi Teacher) <span class="comment-author-role-label author-label">Author</span>

    Just be aware that using the background changes your SEO value to nothing for the image, since backgrounds are decorative. For that specific use case you may need to just crop the image before uploading.

    Reply
  9. Arnoud

    Hi Nelson,
    In relation to this question (to avoid heads being cut off), how can I vertical align a feature image to the top within the 16:9 aspect ratio?
    By default it is vertically aligned centered it seems

    Reply
  10. Hemant Gaba

    Hey Leon,

    I tried to replicate what you are trying to achieve on my end and everything is working fine. Please make sure that you are following the steps properly.

    Reply
  11. Hemant Gaba

    Hey Rachel,

    I guess the issue is already resolved on the website. Please let us know if you need any further assistance.

    Reply
  12. Hemant Gaba

    Hey Sonja,

    I am afraid but I need the URL so that I can spot or replicate the issue on my end and then provide a best solution for the same. Whenever the website get’s ready, please share the link so that I can see what can be done. 🙂

    Reply
  13. Hemant Gaba

    Hey Alan,

    I am afraid that I am not able to spot any issue with the blog featured images as they look perfectly fine on my end. Please try using a different browser and see if that helps.

    Let me know how it goes. 🙂

    Reply
  14. Hemant Gaba

    Hi Aurora,

    Could you please share the URL where you are facing this issue for me to investigate further?

    Reply
  15. Hemant Gaba

    Could you please share the screenshot of the braces issue or the error that you are getting for our better understanding?

    Reply
  16. Dieuwertje Leenaarts

    I added the CSS and used your tutorial for the images. It adds now a big white part on my website and it happens when I add the image CSS.

    Reply
  17. Nelson Lee Miller (aka The Divi Teacher) <span class="comment-author-role-label author-label">Author</span>

    Hi Dieuwertje,
    It looks like the issue is actually related to having 4 columns. I assume you used my other tutorial for that, and if so it looks like you missed the code at the end. You need to have this added:
    .et_pb_posts .et_pb_post {
    -webkit-column-break-inside: avoid; /* Chrome, Safari, Opera */
    page-break-inside: avoid; /* Firefox */
    break-inside: avoid; /* IE 10+ */
    }

    Reply
  18. Nelson Lee Miller (aka The Divi Teacher) <span class="comment-author-role-label author-label">Author</span>

    Hi Rickard,
    I’m not sure what your point is, but I don’t make Divi, I make solutions for it. Be sure to check the other tutorial that is linked to uncrop the photos to the original aspect ration you upload it at.

    Reply
  19. Nelson Lee Miller (aka The Divi Teacher) <span class="comment-author-role-label author-label">Author</span>

    Hi Jessica,
    Do you mean you uploaded the same ration image as what you are trying with the code? In that case, the tutorial we have linked in the one above would be better suited for your situation.

    Reply

Leave a Reply to Hemant Gaba Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

0

Your Cart