WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Post thumbnail crop

[Resolved] Post thumbnail crop

  • 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 1024×768.

    The problem is that it’s cropping the image to 400×300.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator kmessinger

    @kmessinger

    What do you have under settings, media?

    I have Medium thumbnail as 450×300 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 400×300 and not 450×300 is that a 1024×768 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 450×300.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Post thumbnail crop’ is closed to new replies.
Skip to toolbar