• I am working on a child theme of Twenty Thirteen, but the problem persists (in both display and image upload, see below) when Twenty Thirteen is activated too.

    Small images in the sidebar and images in a post display fine. BUT a featured image is cropped top and bottom–not compressed, cropped.

    When I look in the uploads file, there is one version of each image that has incorrect proportions, and always has 270 for the height. If I switch themes to Twenty Thirteen and upload another image, the same thing happens.

    For example, one image is natively 225×346. It is there in uploads, along with a “medium” (set to 300 max for both dimensions) as it should be, 195×300. AND there is an image at 225×270. It is not squeezed to those dimensions: the top and bottom are cut off. The featured image displays this image.

    In Settings, the thumbnail is set to proportional. None of the image sizes in settings has 270px as a size constraint. I can’t find a place in the CSS that proportions of the featured image are controlled–and the damage seems to have been done in the upload process anyway!

    How can I get Twenty Thirteen to stop cutting off heads and feet (as it were)?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter marthaleeturner

    (@marthaleeturner)

    It happens if I change the theme to Twenty Fifteen, too, and upload a new image: there’s an image constrained to 150px in longest dimension (thumbnail), one constrained to 300px (medium)–all properly proportional–and then one out of proportion, disproportionately wide for its height, and with top and bottom cropped from that height. Plus the original image.

    For example (uploaded while Twenty fifteen is active):

    …/wp-content/uploads/2015/02/buddha-2-karen-armstrong-98×150.jpg
    …/wp-content/uploads/2015/02/buddha-2-karen-armstrong-196×300.jpg
    …/wp-content/uploads/2015/02/buddha-2-karen-armstrong-226×270.jpg <<<
    …/wp-content/uploads/2015/02/buddha-2-karen-armstrong.jpg [original = 226 x 346]

    Where is the 226 x 270 controlled? How to make featured images display an image not cropped like this?

    Thread Starter marthaleeturner

    (@marthaleeturner)

    Well, I can fix it by changing the parent theme functions.php:

    /*
    	 * This theme uses a custom image size for featured images, displayed on
    	 * "standard" posts and pages.
    	 */
    	add_theme_support( 'post-thumbnails' );
    	set_post_thumbnail_size( 604, 270, true );

    by removing true (and the comma before it)

    BUT of course that is open to being clobbered when the parent theme is updated.

    Copying that code to my child theme functions.php does NOT fix it.

    Just to be clear: (1) the truncation happens at uploading; and
    (2) truncation does NOT seem to be controlled in Media under Settings (where I have width and height for thumbnails both set to 150, and the box beside “Crop thumbnail to exact dimensions” is UNchecked. and
    (3) no, it is not that it does not automatically resize old uploads: I’ve been deleting old uploads and uploading the image fresh and checking results.

    I’m pretty sure I need my functions.php to override what is in the parent theme. But just repeating what is there, with that change, doesn’t do the trick. Can someone help with the right syntax?

    Hello there.
    Try adding this

    function override_thumb() {
    set_post_thumbnail_size( 604, 270 );
    }
    add_action( 'after_setup_theme', 'override_thumb', 11 );

    in your child theme’s functions.php file and then install the Regenerate thumbnails plugin, activate it and go to Tools -> Regen. Thumbnails to run a regeneration in order for the change to be applied.

    Thread Starter marthaleeturner

    (@marthaleeturner)

    Thanks for the reply, nvourva.

    Adding the code above to my child theme’s functions.php file caused front and back of site to disappear!

    Accessed with TextWrangler, deleted code, site is back now.

    Except I have the same cropped images still.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘cropped featured images in twenty thirteen’ is closed to new replies.