In your theme’s functions.php add a call add_image_size($name, $width, $height, $crop) where $name is the name or identifier for the new size, and $crop is whether the image should cropped to fit the dimensions or just shrunk to fit within the dimensions given. This will register the new size that will be automatically created when you upload new images:
add_image_size('news-thumbnail', 500, 200, true);
Then in the template file for your news post type, call the specific thumbnail size name:
the_post_thumbnail('news-thumbnail');
Related Posts:
- WordPress fails to auto crop featured images
- Can’t edit images
- There has been an error cropping your image
- Make custom thumbnail size crop to EXACT dimensions
- SVG showing only in square ratio (using elementor) [closed]
- Custom image size / thumbnail – Crop to aspect ratio even when source image is smaller than set dimensions
- Custom post type with a forced fixed aspect ratio image crop
- How to delete resized (cropped) image uploads and prevent future resizing?
- Why WordPress automatic cropping all my images?
- Prevent WordPress from cropping GIF files
- 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
- How to crop thumbnail height to auto with set width
- add_image_size() zoom-crop
- the_post_thumbnail scaling not hard cropping
- Is is possible to crop an image after uploading
- Cropping, Re-sizing and Saving images from one folder to another folder in wordpress
- using media uploader to select image of specific size, enforce cropper
- add_image_sizes ignoring crop sizes and using proportion
- “There has been an error cropping your image” when cropping image
- add_image_size is scaling, even though crop is set to true
- Image resize with image url
- Override default cropping in WordPress [duplicate]
- 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
- Add_image_size not cropping
- Use get/the_post_thumbnail with Custom Size & Crop
- How to crop image from center using wp_image_editor
- Cropped thumbnail still displaying as full image
- Crop image from get_theme_mod Customizer field
- Generated media have incorrect aspect ratio
- Why does the Hard Crop option Scale?
- Local WordPress installation doesn’t crop images
- How to upload multiple images on frontend to ACF gallery using update_field
- 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
- Forcing a user to crop the featured image in a certain aspect ratio
- Edit image results in copies of file being created
- Crop image with full width
- How to both crop (with tool) and resize thumbnails having only a max width constrain?
- media resize/crop possibilities?
- Force image crop size in media editor
- Stop WordPress from cropping images using url parameters
- How to have the thumbnail cropping tool working
- WordPress images not cropping properly
- Mass crop images: Landscape images -> Portrait images
- Getting Different Size Of Attachment Images
- Server B handling add_image_size() differently than Server A
- wp_get_attachment_image_src on multisite
- Image with large file size not cropping
- WordPress image crop probems
- How do I get a smaller size of an avatar image
- Can’t locate custom image sizes defined by child theme
- Force square image crop during upload?
- Thumbnail generating and posting
- Disable image rename on upload
- Auto-crop width, not height
- wordpress add image size crop function not working in version 3.8
- Woocommerce: Set thumbnail detail (clipping area)
- VT-resize (great alternative to timthumb) : Errors cropping (litespeed, centos 6.3)
- Cropping thumbnails to specific dimensions on front end post
- Using catch_the_image to get the thumbnail size
- Plugin to select the custom image crop area
- Apply manual image cropping not to thumbnail but medium_large size
- Removing extra large generated images disables all crops
- Disable Responsive Image Sizes crop
- Crop an image after upload on custom account page
- WordPress not using edited image
- Change default “Apply Changes To” radio option when editing images
- variable crop option with add_image_size()
- Thumbnails resized and not cropped in the center
- WordPress crop image not working [closed]
- Retina ready for uploaded images which are cropped
- Featured Image Thumbnail Sizing
- Post thumbnail height problem
- Set image dimension for WP_Customize_Image_Control images
- how to embed a crop feature for cropping images uploaded by the user
- How to crop image in WordPress with aspect ratio for any size of image
- How to get WordPress to resize images for srcset?