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
- How do I remove inline style in featured image markup?
- Custom image size vs CSS sizing
- Getting Different Size Of Attachment Images
- In creating a theme, how can i allow a user to change an image outside post/page content?
- I used single quote to design HTML of my WordPress blog. Now site redirects to index.php everytime than page.php or single.php
- Change Responsive Images Maximum Width of 1600px
- Set a featured image as a replacement to the header image
- Dynamic Post Thumbnail →
- 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 retrieve the image title for image Post Format
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- How to safely return the HTML?
- Theme logo metadata into template file
- Converting a static HTML template into a WP theme – How do I specify page content?
- WordPress creating images if uploaded image is greater than 960px on one side?
- Full width featured thumbnail
- multiple html/css files for wordpress theme?
- How to fix WordPress images not showing up in local hosted XAMPP server?
- Why I obtain different visualization when I run the website on my local machine and on remote server?
- Some doubts about WordPress handle the horizontal main menu visualization
- How to create a WP theme that use BootStrap? [closed]
- my single.php is mixup on some post for no reason
- Does wordpress add their own classes into nav menus?
- Change Image Sizes for Mobile Theme
- How can I get the featured image or the first image for a post/page and display it as a banner?
- 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?
- How can I remove image taxonomy pages from my theme and from Google?
- Dynamic Image Links Depending on Excerpt/’Single Post’ View
- Designing a custom archive.php inspired by the Autofocus theme
- Displaying images outside the content
- ACF get_sub_field ALT TAG in the repeater doesn’t show
- WordPress Animation Adjustments
- Post Featured Image Custom Sizing?
- Social-Link block not loading html on page with custom theme
- 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
- How to add an image to a theme page template in code?
- 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
- Customizer Image-Picker Preview Not Working
- 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
- Featured Image Module Randomly Disappears
- Create image with imagepng() (fails at header)
- Single Featured Image Repeating
- 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
- apply_filters to featured image
- Custom image size doesn’t work
- Retina ready for uploaded images which are cropped
- Standard Way To Do Custom Work Within A Page?
- Show post thumbnail only if it exists using timthumb
- Add rel to all images in a post
- How can I get rid of the distance when I’m using list-style-type: none? [closed]
- Display Page featured Image as well as Posts featured Image
- How can I add a single image from a gallery into the page header?
- HTML to WORDPRESS [closed]
- Which function(s) to build a paged HTML table
- Isotope overlapping .items because of featured images – HELP! [closed]
- Is there a way to prevent wp_head from outputting self-closing tags?
- Custom Theme functions.php – Using add_settings_field and input type=”file” to set custom logo
- How do I work with responsive images in WordPress? (img srcset/sizes)
- Dynamic nav menu with icons [closed]
- Convert base64 string to WordPress attachment uploads multiple images instead of a single one
- add_image_size() parameter four ($crop = true) is ignored: the_post_thumbnail() returns scaled image(s) instead of hard cropped