Install plugin: https://wordpress.org/plugins/force-regenerate-thumbnails/
and regenerate all thumbnails.
Or steps:
-
Create new dimension for images:
add_image_size ('thumb-cropped', 227, 133, true); // Set necessary sizes (true = cropped) -
Get images with the sizes in you function.
get_the_post_thumbnail($post->ID);fix to:
get_the_post_thumbnail($post->ID, 'thumb-cropped'); -
Install plugin: https://wordpress.org/plugins/force-regenerate-thumbnails/
-
Inter in admin area and regenerate all thumbnails
-
The end. Use all new images with fixed dimension
Related Posts:
- How do I change/modify the_post_thumbnail(); html output?
- What’s the best way to use the Featured Image for responsive web design?
- Adding Featured Image to Post programatically
- How to upload imagick resource to media in wordpress
- How do I get images (with a thumbnail preview) to show in search results?
- Assign a picture URL to a page via PHP
- How to scale image with equal width and height without distortion?
- Echo URL of large version of Featured Image
- Recent posts with featured image or fallback image with permalink
- Set the background to a default image if there isn’t a specified “featured image”
- Three Questions with Twenty Eleven theme
- Resize image to specific dimension (X to Y ratio)
- Where are the src and srcset sizes coming from?
- Get featured image with custom size outside WordPress
- Else/If Statement to Display Photo Descriptions
- How to set a featured image (thumbnail) with PHP?
- How to Make Thumbnail of Post Stay Animated
- not outputting medium size image URL
- Configure WordPress to Use Responsive Image Rendering
- Replace background image with post thumbnail in shortcode
- Resize post thumbnail
- add class to background image
- Setting post thumbnail sizes in template file and functions.php
- add if statement to the featured image
- Remove default Image Sizes
- Understanding responsive imagery
- Generate and upload screenshot as featured image for user-submitted post
- Restricting Image Upload Sizes using ‘wp_handle_upload_prefilter’ – Stuck media progress bar when Featured Image?
- How to add a class to the attachment images
- Change the filename format of saved featured images
- How to register images uploaded via FTP in media library?
- Using file_exists to check file in Uploads
- Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”
- Rename image uploads with width in filename
- Generating Responsive Background Image Sizes in PHP
- Add custom image sizes to media uploader
- Conditional Statement – check if post has an attachment image
- Use Filename for Alt and Title Tags
- Adding featured image via PHP
- WordPress loop specific thumbnail size
- Add custom HTML to posts page
- fallback image for featured image
- Display All Post Attachments and Assign Class to the Last Image?
- How to make thumbnail image fit into a div where image dimentions are completely different?
- Change logo based on incoming domain
- Theme currently showing thumbnails, how to show full size?
- Get most recent media upload
- Convert all images to PNG on file upload
- Auto crop images in WordPress
- Get different images for mobile and desktop with php, advanced custom fields without using js and ajax
- How to stop featured image thumbnail [set as background image] on blog index page just repeating same image across all posts
- Trying to add attribute to my posts’ featured image
- Cannot display or echo alt text on featured image
- Mass update excerpt
- PHP variable = get_the_post_thumbnail_url outputting without slashes
- How to get next image with this code from same post?
- get_children displaying images removed from the page
- “imagejpeg” function is not working in wordpress
- Display image from an external rss feed on wordpress without plugins
- WordPress function when file is uploaded, deleted or edited
- height should be set to auto to avoid pixelation in the post thumbnail function
- Download images from media library to computer in BULK?
- Display related posts without a plugin
- Reduce size of responsive title
- How to loop through all the attached images in a post, and get their url one by one
- WordPress function and string as variable?
- Division by zero error in image.php
- Clickable image link sends people to wrong URL
- Only show image from custom field when present
- Upload non-featured image to image field
- Display an image based on field value
- Image rotation issue (horizontal picture uploading as vertical) — Exif issue?
- WordPress İmages Upload & Delete Error
- Call featured image url
- Attaching images to posts manually (i.e. with custom code, without the use of an API)
- Trying to change featured image from 180×180 to full width on home page
- Show different size featured images (the_post_thumbnail) for 1st, 2nd and 3rd posts?
- How to internationalize header image?
- I can’t set image ad fatured programatically
- WordPress api post image raw data without being blank in media library
- WordPress loading all local images from specific directory?
- I have a background-image in css file but don’t show in site.how to fix this prblm. i sent screenshot. thx
- How do I stop an Image Address from loading in the Browser?
- WordPress Responsive Image ( srcset ) not work properly
- How to put 2 php codes in functions.php without site crashing
- How to add a PHP scripts into WordPress
- WordPress generate images size after upload
- Add a default style if no Featured image is selected
- Having trouble with customizing blog posts on the home page
- get_post_thumbnail_id returns a negative number
- How do I get the featured post to share on Social Media and show on Individual Post pages?
- Basic PHP question (displaying post title over thumbnail) [closed]
- insert thumbnail image from php script
- How to resize an image server-side before upload?
- Snapshot Theme from WooThemes — empty ‘alt’ attribute
- HTML in PHP problem [closed]
- An automatic way to crop images of different sizes
- Use URL query string in img src attribute
- Add/alter image attribute before render
- medium_large image size not displaying properly on the frontend?