All Collections
Divi Documentation
Customizing Divi
Portfolio Images Are Being Cropped
Portfolio Images Are Being Cropped

Portfolio Images/Thumbnails Are Being Cropped

Karen avatar
Written by Karen
Updated over a week ago

Normally, you can use any image size for your posts and Divi will automatically crop and resize the images to optimize your pages and perfectly align it in the Portfolio module. 

The ideal size for the Blog post items is 400x284px, but not less than that. This means it's  1:0.7 aspect ratio. You can use a bigger size for the images but make sure they have the correct aspect ratio. To calculate the correct size, you can use the following aspect ratio calculator:

To change the thumbnail size you will need to add this code to the functions.php of the child theme, make sure to use one, you can learn about how to create one here:

function custom_portfolio_image_width($width) {

return '600';

}

function custom_portfolio_image_height($height) {

return '400';

}

add_filter('et_pb_portfolio_image_width', 'custom_portfolio_image_width' );

add_filter('et_pb_portfolio_image_height','custom_portfolio_image_height' );

add_image_size( 'custom-image-size', 600, 400, array( 'center', 'center' ) );

If you want the images to be displayed with their original size, replace the values with 9999.

After you changed size you will need to regenerate thumbnails, here is the plugin for this: https://wordpress.org/plugins/regenerate-thumbnails/

Did this answer your question?