[resolved] Post thumbnail crop (4 posts)

  1. greencode
    Posted 5 years ago #

    I have the following set up in my functions.php

    add_image_size( 'medium-img', 450, 300, true );

    and I have uploaded an image that is 1024x768.

    The problem is that it's cropping the image to 400x300.

    Is there any way I can get images that are not of the same ratio to crop at the size I've specified?

  2. kmessinger
    Forum Moderator
    Posted 5 years ago #

    What do you have under settings, media?

  3. greencode
    Posted 5 years ago #

    I have Medium thumbnail as 450x300 but I'm using the functions.php so I can add more sizes than those in the Settings > Media section.

    The reason why it's only cropping to 400x300 and not 450x300 is that a 1024x768 image with width of 450 then has a height of 338 which is too high so it's cropping it to the height of 300.

    However I need it to crop at exactly 450x300.

  4. greencode
    Posted 5 years ago #

    Ah ha, I've just installed and run Regenerate Thumbnails and that appears to have done the trick!

Topic Closed

This topic has been closed to new replies.

About this Topic