Add this code to your theme’s functions.php file. Images are resized by WordPress when they are uploaded. A plugin such as Regenerate Thumbnails can be used to ensure that source images have been properly generated if image sizes are changed after the initial upload.
// Sets the parameters for the post-thumbnail image size
// https://codex.wordpress.org/Function_Reference/set_post_thumbnail_size
add_action( 'after_setup_theme', 'wpse239844_image_sizes' );
function wpse239844_image_sizes() {
set_post_thumbnail_size( 470, 370, true ); // $width, $height, $crop
}
Related Posts:
- The the_post_thumbnail without srcset?
- Get the first image from post content (eg.: hotlinked images)
- Unexpected width and srcset attributes for the_post_thumbnail();
- Cannot get full thumbnail size using the_post_thumbnail
- Reasons why all thumbnail sizes aren’t working
- How do I Add images uploaded in the post to a default custom field
- How To Pick Custom Size Of Uploaded Image In Theme Via the_post_thumbnail();?
- How to disable thumbnail filter for a specific template part or image size?
- How to make excerpt image be full size instead of thumbnail?
- How can I scale down the width of images in bulk that are embedded in posts throughout the site?
- Add image URL automatically to custom field?
- theme directory fallback image outputs url and not the image
- Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix
- I want to resize post featured image without cropping image. How?
- WP “optimizing” PNGs into thumbnails 5X larger than originals – FIX
- optimized PNGs 5X larger than originals
- WordPress Theme Preview Image
- How do I change/modify the_post_thumbnail(); html output?
- How can I set image sizes and still have responsive images using the srcset attribute?
- Why doesn’t default WordPress page view use force_balance_tags?
- Add default Backgrounds
- Edit srcset and sizes attributes in Gutenberg image, cover and gallery – blocks
- How to add a 2nd “featured image” to a post?
- add_image_size is scaling, even though crop is set to true
- How do I get gallery thumbnail URL and change the default thumbnail size?
- Responsive class to all the images in the content
- How to use SRCSET with get_the_post_thumbnail()?
- How wordpress handle upload images and how to use them in the code
- Replace Home with image link inside custom header menu
- Featured Image Size
- Change display of featured image for pages in twenty seventeen theme
- How to regenerate thumbnails when they’re stored on S3
- Where is definied the theme location for the main menu in a WordPress template?
- A mystery 300px image size
- How to prepare the HTML for WordPress [closed]
- Can’t show custom post thumbnail sizes as background images
- Custom Field returning Numerical Value for Image rather than URL
- Featured Images are not able to be set
- Why an arugment is missing in wp_get_attachment_image_attributes?
- How to make a local cache of mshots images
- How can I wrap html around the output of the_time function?
- attachment.php code or tutorial
- Change “Thumbnail”, “Medium” and “Large” image sizes using functions.php?
- WordPress Media Uploader in page template (On Front-end)
- Responsive Images – crop don’t seem to work
- Reactor Theme: Prevent Post Thumb on Post
- Inserting images in multiple posts native gallery
- Add attachment for all images in post
- Changing Header Image Every N Minutes/Seconds
- Do not display post images on front page
- Is it possible to include an HTML flat-file website inside a WordPress theme?
- Is there any tool to find lines of codes responsible to generate front-end HTML elements?
- Getting Different Size Of Attachment Images
- I used single quote to design HTML of my WordPress blog. Now site redirects to index.php everytime than page.php or single.php
- How to show a manageable list of images on a post?
- Theming Using Bootstrap Glyphicons and WordPress Dashicons
- Issue on Getting Custom post type Thumbnail’s URL
- Change image size depending on page
- Random white space before doctype
- How to obfuscate theme directory URLs
- the_post_thumbnail() get the URL to the “medium” sized image
- Are seven additional image sizes are too many?
- Remove link on full-size images
- How to safely return the HTML?
- Full width featured thumbnail
- How to fix WordPress images not showing up in local hosted XAMPP server?
- Some doubts about WordPress handle the horizontal main menu visualization
- my single.php is mixup on some post for no reason
- Change Image Sizes for Mobile Theme
- Stop WordPress from showing images on non post pages
- How to add cropped custom header image?
- Is there a way to serve different resolution images to different devices?
- Designing a custom archive.php inspired by the Autofocus theme
- Displaying images outside the content
- Post Featured Image Custom Sizing?
- Twentytwenty theme p-tags break em- and strong-tags that span several paragraphs
- How do I change the color of individual page titles in WordPress?
- Image cropping isn’t working correctly when using Offload Media
- Created blank theme for REST API, featured image not appearing on admin side
- Whether an tag is required in header?
- Why .widget-area is outside of .site-content in Underscores starter theme?
- Responsive Images with art direction
- Uncaught Reference error in Retina.js
- Can’t upload images on new theme
- Images use & location, on new wordpress theme
- image sizes – finding and removing
- Full width thumbnail
- Adding a Class to an Getting From Post Content
- Create image with imagepng() (fails at header)
- Why the slideshow is not shown in my theme?
- Theme customizer live preview JS- Trying to bind to an html image url without luck
- How do I keep images in posts below a certain size without editing the post?
- the_post_thumbnail fetches wrong image
- Custom image size doesn’t work
- Retina ready for uploaded images which are cropped
- Add rel to all images in a post
- Display Page featured Image as well as Posts featured Image
- How can I add a single image from a gallery into the page header?
- Which function(s) to build a paged HTML table
- Dynamic nav menu with icons [closed]