Limited Time Sale - 10% Discount! Use Code:U5ZBQTEY

Thumbnail Size


This document explains how to change the thumbnail size in the Divi FilterGrid plugin.

* This filter is no longer needed (but still available) as you can now choose your thumbnail size right from within the module’s settings.

By default, the Divi FilterGrid plugin will load 400 x 284 thumbnail sizes in the layout. You can change the default width and height values by adding a filter to your child theme’s functions.php file. In the example below, we’ll change the width to 510px and the height to 382px.

add_filter('dpdfg_image_thumb_width', 'dpdfg_image_thumb_width');
add_filter('dpdfg_image_thumb_height', 'dpdfg_image_thumb_height');

function dpdfg_image_thumb_width(){
    return '510';
}

function dpdfg_image_thumb_height(){
    return '382';
}

Keep in mind that the filter will only work if the thumbnail size actually exists for the size you set. If the thumbnail does not exist, the original image will be loaded, NOT the thumbnail. You can learn more about creating custom thumbnail sizes in the WordPress Docs. Once you create your custom thumbnail size, you’ll need to run the Regenerate Thumbnail plugin to create the new thumbnail size for all of your existing images on your site.

Pin It on Pinterest

Share This