• Hello !
    I try to use
    add_image_size('custom-image-home2', 350, 220, true );
    I add this in functions.php
    But when I add my images in my article, my images are not displaying at the same height. The first image of my first article is 350×225 and then the second is 350×181 …
    To display my images on my website I write :
    the_post_thumbnail('custom-image-home2');

    How can I ask wp to crop my images to strict sizes ?

    I just want to display my image in a div and this image must to fill in the div.

    Thanks for helping

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You can override the default logic used to decide image cropping/resizing through the “image_resize_dimensions” filter. Returning anything but null short circuits the default function and your returned values are used instead. It’s best to review the related function’s source code to gain insight into how to use the filter.

Viewing 1 replies (of 1 total)
  • The topic ‘Images size’ is closed to new replies.