UPDATED
First, let’s create a new image size. We could update one of the existing sites, but we’ll just add a new one for experience sake. Open up your functions.php file and add the following:
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'new-size', 500, 500, true ); // Cropped
add_image_size( 'another-size', 400, 600 ); // Not Cropped
}
Now, when you upload a new image, a version will be saved (assuming that the original is large enough) at the size you set via add_image_size.
For the existing images, you’ll need to generate new thumbnails. Try the following plugin: AJAX Thumbnail Rebuild.
Ok, now let’s update our reference to the new size:
<?php echo get_the_post_thumbnail( $post->ID, 'new-size' ); ?>
And here’s how to get it full sized:
<?php echo get_the_post_thumbnail( $post->ID, 'full' ); ?>
Related Posts:
- Cropped featured image replaces original image in gallery
- Displaying a featured image (only img url) as the img src?
- Exclude featured image from gallery in wp-admin
- How to display original unmodified thumbnail
- attach several images to post + gallery
- How to change Gallery image url in product page ? In function.php?
- Getting top Image From the Gallery and printing out a thumbnail with Exact Dimensions
- Filter to remove image dimension attributes?
- Stop wordpress from hardcoding img width and height attributes
- WordPress adding scaled images that don’t exist (1536×1536 and 2048×2048)
- Is there a hook which fires after all thumbnails are generated?
- How to have different captions for same image, for galleries?
- Featured image shortcode
- How to find attachment by it’s name?
- WP 3.5 and Galleries – how to count images?
- Image Scaling using get_the_post_thumbnail issue in WordPress
- How to create thumbnails with a fixed width, so all of them will have the same width?
- Change the output for [gallery] shortcode
- Black and White thumbnails
- How can I add the “Use as featured image” to a custom metabox?
- Excludes posts that don’t have attachments in the_content()
- How to remove title attribute from gallery links and images
- The WordPress Gallery, Grabbing The Link and Images?
- How to output placeholder image if no featured image set?
- How to force WordPress to add new images at the beginning of the gallery?
- Featured Images on Front Page
- Download button for Featured Image in every post – automatically
- Show prev and next post links for parent post of current image in attachment page?
- Add a featured image in my theme?
- Featured Image .svg height and width 1px only
- How to check if user is uploading/setting an image as a featured image?
- Images are randomly deleted from server
- Thumbnails are bigger in size than the original image
- Gallery post images on homepage?
- How to create a simple slideshow out of a post image gallery?
- Lazyload post thumbnails
- How to change the target size of images clicked on in WordPress standard gallery
- Featured images not displaying at full resolution
- wordpress get gallery images title
- Big Image on Featured Post, Normal on Single Post
- offload media to external services [closed]
- Customizing the attachement page to show rest of all images in a gallery from post
- Update old Post image metadata to ‘thumbnail’ wp_attached_file
- How to stop wordpress always displaying full-res images
- Retrieve an array of image URLs that belong to a gallery
- Ho to add “Create Slider” option to default “Add Media” popup?
- WP keeps looking up post thumbnail on https even though wp-config says http
- WordPress PNG compression issue
- How to replace images?
- Creating a post image to show in a gallery
- Don’t show images inserted into content
- Native gallery sorting is ignored
- Get custom thumbnail sizes [duplicate]
- Using Jetpack carousel w/o creating a gallery [closed]
- Custom responsive ‘featured image’ sizes
- Load Gallery Images with Title on Homepage BX Slider
- Re-ordering images in existing post in wordpress 3.6.1
- What can i do add title to ‘large’ image?
- Retrieve Image Attachments Getting Post Thumbnail Image First
- Autosort uploads in galleries by filename
- One picture belonging different galleries?
- How to set minimum required size for featured image?
- Hide Featured Image box – isn’t working?
- Show (print) featured image all dimensions (height, width)
- Serve different images per screen size and cache possible?
- Product Images Low Quality After Updating From WP 3.5 to 4 [closed]
- adding image to post thumbnail from another server
- Set Featured Image not opening – Stuck at loading
- Convert featured images into “product images”
- Resize uploaded images [duplicate]
- Pagination between images (active/inactive)
- How to use the thumbnail size with catch_that_image
- Thumbnail and image management
- my featured image of wordpress are not showing in the front end though image are uploaded in media library
- How do you obtain a list of all image file names on a wordpress website for replacement?
- Implementing a modal(lightbox) for all images in all post-gallery posts
- How is called this thumbnail slider feature
- Custom image size not displaying with wp_get_attachment_image()
- Images getting smashed
- How to delete original image file after upload and resize
- An error has occurred during the upload process in wordpress version 5.3.2
- Show featured image in all posts
- How to re-arrange images in default WP Gallery more than one image at once?
- Convert multiple image blocks to gallery block in Gutenberg?
- Images 404 after wp migration to a subdomain
- Exclude first image from a Woocommerce image gallery
- Custom Background for each page and post
- Using custom field to change alt text for a featured image
- How to display image thumbnails on the search results page?
- Gallery Images could not be shown
- Get custom size of thumbnails
- Gallery with shortcode not showing
- How to display every pictures from all the posts on one page?
- How to add multiple images in a page
- Paginate Gallery [closed]
- Adding different classes to different images depending on size for fine control of image layout in posts
- I tried to move the featured image below the paragraphs but now it is displaying twice
- How to import external media items into wordpress media library (without using storage)
- Is there a way to upscale a media library original image to the nearest whole pixel in WordPress?
- Images uploaded in customized gallery do not link to media