Search code examples
wordpresscropimage-gallery

WordPress gallery grid show original image


I'm using the Divi theme to build a website in WordPress. The problem I'm facing is this:

wrong image

I'm using the gallery module to display a set of pictures in grid mode. But all the images loaded are shown as above. Id like to display the original image instead of the medium one.

original image

WordPress creates some versions of my images but the aspect ratio is different, so this crop effect is applied on my gallery items.

I have tried to set the correct size on medium images from media settings and generated the images again but nothing changed.


Solution

  • Divi theme uses its own functions to generate thumbnails that hard crop original images by default. Try editing post_thubnails_divi.php file on theme folder using the dimensions that suit you and set the crop value to false.

    $crop = apply_filters( 'et_post_thumbnails_crop', false );