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?
- How do I change/modify the_post_thumbnail(); html output?
- How to modify an image block in Gutenberg WordPress 5?
- 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
- Hide a div that is part of all pages on one specific page
- Can’t get staging site to display same way as live site. Completely stumped
- wp_get_attachment_image_attributes not working for me
- Specify image dimensions
- How to get gallery images?
- Snippet: Use classes instead of inline styles for text alignment
- How to change post thumbnail title and alt attributes to post title?
- add_image_size is scaling, even though crop is set to true
- Featured Image in 4.4 should be larger on mobile device
- How to use the responsive images feature from WP 4.4 in your themes
- How to handle thumbnails
- Replace Home with image link inside custom header menu
- How to regenerate thumbnails when they’re stored on S3
- wp_get_attachment_image_src() width and height boolean
- How to float an image in Gutenberg
- Can’t show custom post thumbnail sizes as background images
- Featured Images are not able to be set
- Display recent posts with thumbnail
- How can I wrap html around the output of the_time function?
- image url relative path not working in css file
- How do I build a post_thumbnail based archive? [closed]
- How do I turn a post thumbnail into a background image?
- Reactor Theme: Prevent Post Thumb on Post
- Inserting images in multiple posts native gallery
- Can I get the ID of an inserted / linked image?
- What’s stopping my HTML from rendering in my template parts?
- Do not display post images on front page
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- Redirect to another page using contact form 7? [closed]
- Gallery thumbnails very small
- Featured Image meta box not showing up
- Is there any tool to find lines of codes responsible to generate front-end HTML elements?
- How do I remove inline style in featured image markup?
- Custom image size vs CSS sizing
- 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?
- the_post_thumbnail() get the URL to the “medium” sized image
- 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
- 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?
- Why I obtain different visualization when I run the website on my local machine and on remote server?
- 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?
- How can I get the featured image or the first image for a post/page and display it as a banner?
- How to add cropped custom header image?
- How can I remove image taxonomy pages from my theme and from Google?
- Dynamic Image Links Depending on Excerpt/’Single Post’ View
- ACF get_sub_field ALT TAG in the repeater doesn’t show
- WordPress Animation Adjustments
- Social-Link block not loading html on page with custom theme
- How do I change the color of individual page titles in WordPress?
- How to add an image to a theme page template in code?
- Customizer Image-Picker Preview Not Working
- Images use & location, on new wordpress theme
- 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
- 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?
- apply_filters to featured image
- 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]
- How can I add a single image from a gallery into the page header?
- HTML to WORDPRESS [closed]
- 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)