Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1488325

    I want to add new image dimention i.e tab_thumb thats width is 260px and height is 80px. How can i add.

    #1488456

    Hey Taha,
    Thanks for your patience, add this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    add_filter('avf_modify_thumb_size', 'custom_modified_thumb_sizes', 10, 1);
    function custom_modified_thumb_sizes(array $sizes) {
        $sizes['tab_thumb'] = array('width' => 260, 'height' => 80, 'crop' => true);
        return $sizes;
    }

    then upload a new image, then add your image to the image element:
    Screen Shot 2025 08 23 at 3.46.38 PM
    then go to the style tab and select the new size:
    Screen Shot 2025 08 23 at 3.49.34 PM
    the backend may show the full uncropped image, but the frontend will show the new image size.
    After testing, if you want all of your images to have this new size, install the Regenerate Thumbnails plugin and run it.
    Since your new size won’t work will for most images changing 'crop' => true); in the code to 'crop' => false); won’t help, unless you are uploading a image that is already 260×80, or a multiple of that aspect ratio without cropping.
    For example, this image was a very large image, and after Regenerate Thumbnails it shows the in the new size:
    Screen Shot 2025 08 23 at 4.05.24 PM

    Best regards,
    Mike

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.