WordPress has built in sizes for your photos that it automatically creates when you upland an image.
You can call different ones by using
get_the_post_thumbnail( $post_id, 'thumbnail' ); // Thumbnail (Note: different to Post Thumbnail)
get_the_post_thumbnail( $post_id, 'medium' ); // Medium resolution
get_the_post_thumbnail( $post_id, 'large' ); // Large resolution
get_the_post_thumbnail( $post_id, 'full' ); // Original resolution
if those don’t fit exactly what you’re looking for you can create your own size too:
add_image_size( 'my-custom-size', 220, 180 ); // 220 pixels wide by 180 pixels tall, soft proportional crop mode
and then call it by the same as above:
get_the_post_thumbnail( $post_id, 'my-custom-size' );
Related Posts:
- Add padding while generating thumbnail
- Display Multiple Photos as Featured Image when mouse moves on to it post
- How can I make add_image_size() crop from the top?
- How to Delete All regenerated thumbnails but keep the original ones?
- Using Advanced Custom Fields with WordPress and Lightbox
- Thumbnail with different sizes
- Converting Attachment to Images?
- Redirect to another page using contact form 7? [closed]
- Plugin to hide image in excerpt
- Add “Featured Image” box in my plugin post page
- Scrape a webpage for image and add it to post
- Regenerate Thumbnails Plugin successfully updated my thumbnails but image src won’t change to new image size?
- Add_image_size not generating correct size
- How to hide featured images of all posts falling under the same category in wordpress?
- Upload Image with a file URL and show dynamically on Frontend
- insert og image link in wordpress post
- WordPress create thumbnails on demand
- How to force regenerate thumbnails in WordPress posts?
- resizes images on the fly
- Determine if get_the_image has image on Get the image Plugin
- Retrieve post thumbnails
- How can I server scaled images?
- set_post_thumbnail_size vs add_image_size
- How to custom crop each image size?
- New image size version only for the Featured Image file
- Is it possible to “freeze” a WordPress blog?
- Display (and manage) webcam images?
- Cropping, Re-sizing and Saving images from one folder to another folder in wordpress
- How to make WordPress use protocol indepentent upload files?
- Modify featured image URL at runtime
- No srcset for hard-cropped thumbnails
- How to extract images of post and pages excluding header and logo image in wordpress?
- Use Media Uploader in Plugin
- Removing Title Tag from Thumbnails
- Changing playlist shortcode thumbnail sizes?
- Generated Images sizes do not match Media Settings Image Size
- Get uploaded image url
- How to change Thumbnail size of next Gen Gallery plugin?
- Cannot get full thumbnail size using the_post_thumbnail
- How to remove the whitespace in image name and save the new file
- Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory
- Save image as featured image
- AJAX image upload with a upload progress bar using media_handle_upload
- Thumbnails produce unwanted gray pixels on white background [closed]
- How to add css class to a specific set of images?
- How do I make images clickable so as to enlarge them using lightbox?
- Advanced Custom Fields
- Why isn’t “background-image: url”working with Bootstrap carousel on WP?
- How to generate video out of images via WordPress plugin
- How to upload images to WP Panel keeping correct folder in FTP
- How to add an image from web-link?
- Howto accurately position images with maximum flexibility?
- Show an image in my header.php
- Force media library editor to overwrite the original filename?
- Bulk edit WP posts to update embeded images with new alt tags
- Make change in media library affect images in published articles
- Bulk Image Upload And Rerrange Functionality
- Slider/text combination plugin
- Image change on hover
- How to write “alt” tag in image for wordpress code?
- How do I get a post author’s image/avatar via RSS from another blog?
- Plugin that will let me specify a number of image sizes?
- Clear out old images, any advice?
- How to get images using taxonomy ( WP Media Folder)
- adding Adsense’s In-Article Ads between images of blog post
- Large amount image data transfer
- Get Image Having the ID [closed]
- Using Image Sizes for Custom Post Types outside the Loop
- How do I link an image in my plugin so it displays on WordPress?
- Adding featured image to posts created by a plugin
- Is there a way to insert multiple images into a post at the same time without using a gallery?
- Multiple Post Thumbnails Plugin – Need help with code
- I’m having several WP issues, especially with missing images
- Revision featured image
- Bulk Image Resize for Media Library, but for ENLARGING instead of Shrinking
- Enlarge an image slider when click
- Get all image in media Gallery with alt/title?
- WordPress built-in compression of images? How well does it compare to Photoshop or Shortpixel?
- How to Add call button on a featured image in a wpsite? check the slap king image, there are two buttons on the featured image
- Do images in plugins automatically load?
- WP_get_image_editor resizing images in a foreach loop
- Implementing Scrollable Images
- Thumbnails are hard cropped not matter what
- Featured image size always cropped bottom
- Uploading images to custom table
- How to make cover image in post block expand to entire screen?
- How to install ffmpeg extension for php 5.6.25 for wp video posts plugin?
- Images not showing on homepage after migration [duplicate]
- how to open image gallery in a post/page?
- Advanced Custom Field User Help URL
- How to make plugin work in each template in wordpress
- featured image problem with custom post type
- Trying to use Advanced Custom Fields with custom image sizes
- when i use wp automatic plugin post shows broken images
- how to add “alt” for all image in wordpress
- How should I force WordPress to give proper name for the uploading images?
- Woocommerce resize existing product images
- Get URL for featured image for posts? [closed]
- Want to show pop up image on home page every time when i refresh it [closed]
- How do i display the number of images on the “post screen”