• Resolved gaiusjaugustus

    (@gaiusjaugustus)


    I have created custom crops of my thumbnail images. For example, my ‘medium’ images are 300×200 (instead of 300×300).

    Under Size of Thumbnail, I choose “Medium”, but it instead loads another thumbnail size (which is 324 x 324).

    If I change line 65 of widget.php from

    the_post_thumbnail( $this->customs[ 'thumb_dimensions' ] );

    to

    the_post_thumbnail( 'medium' );

    it works correctly. I’d like it to pull the thumbnail by the size_name (size ID) instead of trying to match the dimensions.

    Any help would be appreciated. Thank you for the fantastic widget which improves the look of my blog tremendously!

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Martin Stehle

    (@hinjiriyo)

    The plugin uses the WordPress core functions to get the correct image sizes. No matter whether you call the_post_thumbnail() with a string or an array with the width and the height: WordPress always converts the string into integers for the width and the height.

    Did you specify the ‘medium’ size in “Settings” => “Media” or via add_image_size()?

    Thread Starter gaiusjaugustus

    (@gaiusjaugustus)

    The ‘medium’ size is a default size from WordPress. I am on mobile, and will need to double check, but I’m pretty sure most of the sizes were not working. Not sure if it was only the one with custom sized images (my assumption right now), but I’ll check this and get back on.

    Hopefully this will help troubleshoot?

    Thread Starter gaiusjaugustus

    (@gaiusjaugustus)

    Appears the issue happens with my custom cropped images (which makes sense, since those are the ones that would be the wrong size), all resized using the Post Thumbnail Editor plugin. It doesn’t add custom sizes, just allows you to crop image sizes individually.

    Plugin Author Martin Stehle

    (@hinjiriyo)

    So the case is resolved?

    Thread Starter gaiusjaugustus

    (@gaiusjaugustus)

    No. I still would like to be able to select an image based on size_name instead of width and height (thumb_dimensions).

    Plugin Author Martin Stehle

    (@hinjiriyo)

    I revised the code for both custom image dimensions and image size names. With the version 6.4.1 the displayed image sizes match the registered sizes much better.

    If you like this plugin I would be glad about your review.

    Thread Starter gaiusjaugustus

    (@gaiusjaugustus)

    Just updated and confirming that the update resolves the issue. Thank you so much!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Pulls image by size, not size_name’ is closed to new replies.