Skip to main content
All CollectionsTroubleshooting and FAQsFrequently Asked QuestionsPortfolio Module
How to Remove the Default Cropping of the Post's Featured Image in the Portfolio Module
How to Remove the Default Cropping of the Post's Featured Image in the Portfolio Module

Learn how to remove the default cropping of featured images in Divi's Portfolio Module for a more accurate and attractive presentation.

Updated over 4 months ago

The visual presentation of your portfolio items is key to making a strong impression on your audience. However, the default cropping applied to featured images in Divi's Portfolio Module can sometimes detract from the impact by cutting off important parts of your images.

This article will guide you through the steps to remove the default cropping applied to the project's Featured Images in the Portfolio Module, enhancing the visual appeal and effectiveness of your portfolio.

You can normally use any image size for your projects. Divi will automatically crop and resize the images to optimize your page and perfectly align them in the Portfolio module. When using the Grid Layout, the default size to which each Portfolio's Featured image is cropped is 400x284px, giving you an aspect ratio of 100:71.

Remove the default cropping

  1. Install and activate the Code Snippets plugin

  2. Create a new PHP Snippet and place this PHP code:

    function custom_portfolio_image_width($width) {
    return '9999';
    }
    function custom_portfolio_image_height($height) {
    return '9999';
    }
    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-portfolio-size', 9999, 9999, array( 'center', 'center' ) );

  3. Install and activate the Regenerate Thumbnails plugin

  4. Regenerate all of your Thumbnails

Set a custom aspect ratio for Featured Images

The above PHP code will remove the default cropping functionality, which Divi will apply by default to any Featured Image used for projects. However, this will create a new issue if the Featured images are not all the same size, showing all images unevenly.

Did this answer your question?