Skip to content

Documentation

Extensive Documentation for PowerPack & WooPack to help you with common questions and issues.

PowerPack

⌘K
  1. Home
  2. Docs
  3. PowerPack
  4. Modules
  5. Filterable Gallery
  6. Custom Image Size is not working?

Custom Image Size is not working?

Solution: Please add the following code to your current theme’s functions.php file:

add_filter('image_size_names_choose', function($atts) {
    // Get an array of custom image sizes
    $allImageSizes = wp_get_additional_image_sizes();
    $imageSizes = [];

    // Loop through the custom images, make a suitable array
    foreach ($allImageSizes as $key => $value) {
        $imageSizes[$key] = $key;
    }

    // Merge the new array with the existing, and return
    $atts = array_merge($atts, $imageSizes);
    return $atts;
});
PowerPack Beaver Addons Black Friday Deal
Our Biggest Sale of the Year
Save up to 50% OFF

Wait! Don't Miss Our Biggest Sale of the Year!

SAVE UP TO 50% OFF

Get premium Beaver Builder addons at our lowest prices of the year. Build better websites for less!

Limited-time offer • Don't miss out!

×