Images in the Divi gallery, blog grid, portfolio grid etc are being cropt, so they all have the same aspect ratio (and size). This is how to prevent that and show the original ratio.
Sources:
- https://www.peeayecreative.com/how-to-stop-divi-image-crop/
- https://astucesdivi.com/en/images-rognees-divi/
- See also Change or stop Divi image size / thumbnail generation
Portfolio
// START remove Divi Portfolio and Filterable Portfolio featured image crop
function pa_portfolio_image_width($width) {
return '9999';
}
function pa_portfolio_image_height($height) {
return '9999';
}
add_filter( 'et_pb_portfolio_image_width', 'pa_portfolio_image_width' );
add_filter( 'et_pb_portfolio_image_height', 'pa_portfolio_image_height' );
// END remove Divi Portfolio and Filterable Portfolio featured image cropCode language: PHP (php)
Gallery
// START remove Divi Gallery Module image crop
function pa_gallery_image_width( $size ) {
return 9999;
}
function pa_gallery_image_height( $size ) {
return 9999;
}
add_filter( 'et_pb_gallery_image_width', 'pa_gallery_image_width' );
add_filter( 'et_pb_gallery_image_height', 'pa_gallery_image_height' );
// END remove Divi Gallery Module image cropCode language: PHP (php)
Blog feed
// START remove Divi Blog Module featured image crop
function pa_blog_image_width($width) {
return '9999';
}
function pa_blog_image_height($height) {
return '9999';
}
add_filter( 'et_pb_blog_image_width', 'pa_blog_image_width' );
add_filter( 'et_pb_blog_image_height', 'pa_blog_image_height' );
// END remove Divi Blog Module featured image cropCode language: PHP (php)
You may also want to stop WP/Divi from generating the sizes you don’t use.