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?
- Separate Media Library for each user
- Maintaining image color and quality when uploading using custom sizes
- Bulk edit wordpress images alt and title attributes
- Alter media caption/description conflict in WordPress?
- Separate attachment images from post loop
- Rename attachments during upload
- alt, title tags not showing
- How can I store an image in the database with Transients API?
- How to prevent resized featured images?
- Get original image from thumbnail URL
- Display one random image, but only if landscape
- WordPress url image redirect to the homepage
- Bulk image rotation
- Is there a way to delete images from WordPress media library programmatically?
- Special purpose photos with each post
- WordPress – different icon image depends of comment number
- Change image url size in post editor (when cliking on image)
- Multiple images with Media Uploader on front-end
- Pull Random Attachments With Pagination
- image uploaded cant be shown
- Turn off image captions in gallery view?
- How to get default image sizes attribute
- Unyson Framework doesn’t show gallery images
- add_shortcode to capture URL screenshot not loading correctly
- Is it a good practice to change media settings on theme activation?
- Function to remove all classes on images inserted into posts?
- Images don’t update after being edited
- Display post image in a size defined by add_image_size()
- URL through custom field returning null
- big trouble with javascript
- Display cropped thumbnail not featured image
- Hide image gallery in Woocommerce if NO image [closed]
- All 3?: Responsive resizing of images + image width of actual image for small images + max-width for all larger images
- How to get the cropped image from media library?
- get rid of random string before an for an image path on wordpress
- Responsive Images from S3 has no srcset
- Image modification
- How to only show div of caption if caption exists on featured image
- How to “lazy load” post thumbnail
- Using srcsets in a custom block
- Change Image URL on upload to some random number automatically
- Image title replace with current date
- WordPress Responsive Image ( srcset ) not work properly
- Product Gallery Images to go into full size on Product Page
- How to Display Image Caption but Not Alt Text
- Why image Thumbnail url is not displaying with custom size?
- add_image_size limiting sizes (???)
- Automatically generate multiple image sizes for element
- Responsive Images in WordPress
- Is it possible to remove spaces from existing images? [closed]
- Featured image on page set as “Posts page” in Settings > Reading
- problem with updating metabox of upload image
- How to have a specific image show up for everyone who comments?
- Adding Image Description below Images Inserted into Posts
- Using file extensions in image titles
- Create post thumbnails from images stored outside of uploads directory
- php.ini -Theme-specific settings
- Display X images from a gallery in the sidebar
- How do I insert a photo at the top of the sidebar?
- If image width bigger than height [duplicate]
- How do you add text to a carousel of images like here in this example
- WordPress API, creating Featured Media from image url (nodejs)
- How do I display a PDF thumbnail as a link to the PDF without uploading the image
- medium_large image size not displaying properly on the frontend?
- Featured Image add tab
- ‘apply_filters’ is breaking some shortcodes/HTML but not all