This could be a dumb idea, but what if you set it to
add_image_size('gallery-image', 9999, 600);
As long as you don’t add ‘true’ it won’t crop, it scales to fit into the space by default. It would then try to fit into the smaller of the two, the height in this case, and scale down appropriately. Or you could do the width as the constraint and make the height the ridiculously large one.
Related Posts:
- Missing feature image link function
- Generating Responsive Background Image Sizes in PHP
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Display height and width properties with the_post_thumbnail() or related function
- Removing the first image in content
- Function to auto-set a featured image that is already in use
- wp_get_attachment_image function size argument not working if I also add a custom class
- Overwriting Parent Theme’s Image Sizes
- Can you put a condition on add_image_size() depending on the width of the uploaded image?
- show first 3 thumbnails of posts in different sizes [closed]
- Set spesific size of featured images
- Can’t generate thumbnail images
- How to hide image-url if no attachment?
- How to add a new image size and apply it to posts only?
- Featured Image keeps cropping
- Custom image sizes showing in Classic Editor only when upladed directly to post
- Featured image on archive page based on post type
- Printing medium sized image
- Full size image option removing problem
- Image width issue in IE [closed]
- image_size with respect to aspect ratios
- Add image size if page template
- How do I change/modify the_post_thumbnail(); html output?
- remove links from images using functions.php
- Removing default image size list in Media Box
- How to use get_template_directory_uri() to load an image that is in a sub-folder of my theme?
- Automatically set the featured image
- How to add classes to images based on their categories?
- How to create thumbnails for PDF uploads?
- How to display the_post_thumbnail if a post has one or otherwise display the first image in a post?
- Is it possible to maintain image aspect ratio when scaling images?
- Linking thumbnail to full size image
- Gallery images titles – get from post
- Add a Post Thumbnail to an RSS Feed with custom size
- Make WordPress size and name images for Retina.js
- How to add a rel attribute to images that contains their categories?
- the_post_thumbnail fallback using hooks
- Custom image size in Media Dropdown
- How to set the jpg image compression for specific thumbnail sizes?
- Actions according to image type and size
- Woocommerce Storefront WordPress Ignore Media Gallery Images and use External 3rd Party Host
- How to display a default image for post thumbnail using functions.php?
- How can you limit srcset on a single type of page?
- Change size and crop medium_large images
- Set the background to a default image if there isn’t a specified “featured image”
- set_post_thumbnail when user is not logged in
- Twentyten Child Theme: header images display messed up in admin panel
- Disable auto-resizing of uploaded images, but only for certain filename
- Remove after images
- media resize/crop possibilities?
- Redirect to another page using contact form 7? [closed]
- It does not work concatenation in function.php
- Random Featured Image Based on Category
- How to retrieve the current post’s generated featured image size?
- Check if the image size is available and if not use ‘full’ image size
- Way to store featured image width and height in two separate variables?
- Limit dimensions of “Full” size images
- Can set_post_thumbnail be used to remove a thumbnail?
- Need To Change WordPress Meta Tags… Includes wordpress shortcodes
- How to Add Shortcode to html img code?
- Else/If Statement to Display Photo Descriptions
- Problem in using Customizer
- wp_get_attachment_image_src returns image on main domain, false on subdomain
- Custom Image Size in Insert Media
- resizing of thumbnails not working
- Prevent creating multiple image resizes in twentytwelve template
- Conditional function for excluding first image from content, not working
- get_image_tag() html output : empty src attribute
- How to make excerpt image be full size instead of thumbnail?
- struggling with syntax for the_post_thumbnail();
- include w_thumbnail_src in function?
- Need To Resize Images Exactly Without Losing Image Details
- how can I change all wordpress media file url to custom cdn url?
- Different image using srcset function
- Is it possible to limit number of files a non-admin user can upload via the WordPress media library?
- not outputting medium size image URL
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- remove_filter function to unhook twentysixteen parent theme function
- blank page with wp_get_attachment
- Sticky – Featured Image
- Why am I losing image quality on my site?
- Replace image attributes for lazyload plugin on image elements with specific class
- Best way to add image to recent posts widget?
- No compression occurs on my jpegs after adding jpeg_quality hook to my functions.php file
- Remove Featured Images from Posts Older Than a Certain Date
- Different body image backgrounds on different pages, posts and categories
- Update add_image_size
- Function the_content
- Dynamically adding Captions to images
- add if statement to the featured image
- Is mytheme_post_thumbnails() still necessary?
- How to resize image from import image url?
- How to crop image in WordPress with aspect ratio for any size of image
- Generate and upload screenshot as featured image for user-submitted post
- How to add height and width dimensions automatically to archive descriptions
- How to overwrite image if it already exists – WordPress, Gravity form
- How Do I Prevent Featured Image Caption Displaying Above And Below Image
- How to force Cover block to use the full size image resolution
- Add custom text before all image captions in WordPress posts