voceconnect / multi-post-thumbnails

Adds multiple post thumbnails to a post type. If you've ever wanted more than one Featured Image on a post, this plugin is for you.
143 stars 63 forks source link

Admin thumbnail display #44

Closed Oslaf closed 9 years ago

Oslaf commented 9 years ago

Hugely shallow thing to request, but could the post thumbnail preview image in the admin be styled so it doesn't overflow beyond the padding of the container if it's too wide? It's kind of a visual eyesore when using the extra thumbnail with landscape-style images.

chrisscott commented 9 years ago

This shouldn't be happening... MPT's thumbnail output uses a similar method as core's _post_thumbnail_html() method. Unless you have added an image size that matches "{$this->post_type}-{$this->id}-thumbnail" where {$this->post_type} is the post type the MPT is registered for and {$this->id} is the ID you used when registering the MPT, then it should use an image width of 266px and be scaled vertically appropriately.

Oslaf commented 9 years ago

Hm, I don't think I've got such overlap going on, though my MPT image is registered to more than one (actually, an array of 3) post types, in case that's somehow relevant.

I've confirmed the displayed image is indeed 266px wide (as set in the attributes of the img tag, and matching the equivalent code in WordPress' built-in featured image box above MPT's), but it's not affected by the #postimagediv .inside img { max-width: 100%; height: auto; } rule that would scale it back to the roughly 254px of the container box sans padding (preventing the image from overflowing), since it doesn't match MPT's [post type][dash][registered id] generated id for the same DIV.

chrisscott commented 9 years ago

This has been fixed in 1.6.4. Thanks for the suggestion and followup. I just pushed this to .org so it should be available there shortly.

jusmarks commented 9 years ago

Can you change this from width: 100% to max-width: 100% instead? Because this is making small images huge and blurry.

chrisscott commented 9 years ago

Updated in 1.6.5. Pushing to .org shortly.