This isn’t a really good solution since it’s a newer CSS solution and it’s only working in 78.9% of users browsers, but there are a few polyfills that can overcome that object-fit-images and fitie
img {
display: block;
overflow: hidden;
width: 400px;
height: 400px;
-o-object-fit: cover;
object-fit: cover;
}
Ideally it would be better if the smaller images scaled proportionally on upload, but I haven’t been able to figure out a solution for that.
Related Posts:
- How to delete resized (cropped) image uploads and prevent future resizing?
- Why WordPress automatic cropping all my images?
- How to resize images in wordpress without adding any compression or changing the color profile of the images, possible?
- get_the_post_thumbnail_url with an unregistered size
- Cropped featured image replaces original image in gallery
- add_image_size() zoom-crop
- add_image_sizes ignoring crop sizes and using proportion
- “There has been an error cropping your image” when cropping image
- Image resize with image url
- Cropping an image before inserting into a post
- Why can’t I edit certain images from the WordPress Media library?
- Custom image size not regenerating when image editted
- Local WordPress installation doesn’t crop images
- Confusion about arguments sent to add_image_size
- add_image_size() to crop images into squares?
- is it possible to crop cover images in buddypress?
- WordPress crops images differently on retina screens?
- Hero image cropped at different dimensions
- Show image crop window on image upload
- Edit image results in copies of file being created
- Stop WordPress from cropping images using url parameters
- WordPress images not cropping properly
- Mass crop images: Landscape images -> Portrait images
- How do I get a smaller size of an avatar image
- Force square image crop during upload?
- Disable image rename on upload
- Auto-crop width, not height
- wordpress add image size crop function not working in version 3.8
- VT-resize (great alternative to timthumb) : Errors cropping (litespeed, centos 6.3)
- Plugin to select the custom image crop area
- Apply manual image cropping not to thumbnail but medium_large size
- variable crop option with add_image_size()
- Set image dimension for WP_Customize_Image_Control images
- How to get WordPress to resize images for srcset?
- Overide Gallery Default Link to Settings
- How can I determine if a post has an image attachment?
- replace wp_get_attachment_image with my own function
- get images from post and make a zip
- Default image for homepage when shared in social media
- Disable WordPress Big Image Size Scaling
- Filter Media Library by author or post_parent
- Frontend image uploading from edit profile page. (goldenapples)
- Hook for saving an image after editing
- How to store media files in subdomain
- How do I remove generated HTML around images in posts?
- A way to change image urls in post to cdn image url?
- Get author custom image field URL to display on post page?
- Keep image EXIF info after compressing original image?
- Set Post Image Using Shortcode
- Print specific image size in galley loop
- How can I attach hotlinked images in posts/pages within the same server?
- WordPress Image Attachment using remote image
- Every admin only can see his uploaded images im editor
- Update an image block style programatically
- How can I add a “data-pin-nopin” the featured image html?
- Resize into square the single product image in woocommerce without cropping [closed]
- an error occurred in the upload. please try again later (Maybe File Permission Issue)
- Image Upload HTTP 500 Internal server error
- Animated GIF on WordPress posts? [closed]
- Generate images to be associated for tag and category?
- I have no images in an activated wp theme
- How to know what size image to use for background? [closed]
- Understanding WordPress image sizes and responsive images
- Image large size [closed]
- Partial img lazy load with WP 5.5
- Why doesn’t WordPress use the smaller sized image?
- css to fit image by HEIGHT
- Alt Image WordPress [closed]
- Some Images Disappeared from Media Library?
- What is required in the hosting environment for WordPress to process an image into multiple sizes?
- Get an image from url, resize it, and save on a custom folder (not the media library)
- Moving an image to the side [closed]
- How to add thumbnails to posts and pages automatically in a uniformed fixed elegant way?
- Is it possible to modify default image name suffix?
- image upload/edit is broken: “Image data does not exist. Please re-upload the image.”
- Background Image Does Not Display on Page
- Can’t fix corrupted images
- Deleted Image giving a 301
- Avatar picture is broken
- WordPress append -1 to the image name
- Link to products with the same image title (woocommerce)
- WordPress Single Post image gallery as slider
- WordPress does not load most theme images
- There is an image embedded on my page that I can’t locate in order to delete. Please help me!
- Could creation of various image sizes cause slow form submission response?
- How to add featured image use HTML
- Correct color profile and saving? Thumbnail creation?
- Allow users to upload attachments to certain posts
- WordPress and Advanced Custom Fields and Flickity
- stop wordpress from resizing feature gif images
- Modify media file markup output
- Theme page headers and rotator images not assigned after website migration
- WPML – Change media uploader language
- WordPress Is Saving Original Image Only
- Display images from JS?
- Create a custom attachment thumbnail for quick page load
- Change the image for a certain URL
- How to make an image bigger with wp_get_image_editor
- Display Images from Array with wp_get_attachment_image() [closed]
- Orientation of featured image in post?