You don’t need to do manual cropping; just create a custom image size, and WordPress will perform the cropping on image upload.
e.g. in functions.php:
add_image_size( 'portfolio-thumbnail', 214, 187, true );
Then in your portfolio template, inside the Loop:
the_post_thumbnail( 'portfolio-thumbnail' );
(I assume you know how to handle the rest of the output, such as creating the grid layout, and linking each thumbnail image, etc.)
Note: you’ll have to regenerate thumbnails for any already-uploaded images.
Related Posts:
- How to Fix HTTP Error When Uploading Images?
- Minimum Dimensions Requirement for Featured Image?
- Prevent WordPress from cropping GIF files
- How to crop thumbnail height to auto with set width
- the_post_thumbnail scaling not hard cropping
- Add Image Dimensions to Media Library Tab on Media Upoader
- Custom post type thumbnail / Media Library WP_DEBUG notice [closed]
- Use get/the_post_thumbnail with Custom Size & Crop
- Use wp_remote_get to add image to media library
- Cropped thumbnail still displaying as full image
- Replicate featured image functionality
- Need clear explanation about medias/files/attchments
- Why does the Hard Crop option Scale?
- Forcing a user to crop the featured image in a certain aspect ratio
- How to both crop (with tool) and resize thumbnails having only a max width constrain?
- How to replace featured image upload option with the post media image option
- media-library: how to insert thumbnails with a fixed width, regardless of landscape/portrait orientation
- How to bring files from the upload directory to the media gallery?
- Server B handling add_image_size() differently than Server A
- Image with large file size not cropping
- Images uploaded on frontend display correctly but not in media editor.
- Using catch_the_image to get the thumbnail size
- Removing extra large generated images disables all crops
- Thumbnail (featured image) and Media Library cleanup queries help needed
- Set featured image from auto generated video thumbnail url php
- After migrating media library is not showing thumbnails
- Featured Image Thumbnail Sizing
- How to modify Media Library images DPI [ image quality down to make small in size ] [closed]
- How to delete resized (cropped) image uploads and prevent future resizing?
- Add Title Attribute to WordPress Image the_post_thumbnail
- Replacing Gutenberg Featured Image control?
- oEmbed, thumbnails and wordpress
- Cropped featured image replaces original image in gallery
- Featured Image Inherited from Parent Page
- Change wording of default thumbnail metabox
- Specific featured image for each category
- how to pull images with no add_theme_support(‘post_thumbnails’)
- Can WordPress crop only the post thumbnails?
- Query the post which have a thumbnail
- How to show a featured image as current?
- How can I get a different image size, if all I have is the link?
- Importing featured image to posts, duplicates the image
- How do I set a featured image (thumbnail) by image URL when using wp_insert_post()?
- Images are randomly deleted from server
- Use post thumbnail as div background
- How do I set the default “feature image” size?
- Featured Image missing in WordPress 3.2 Admin
- Change post thumbnail using front end post edit form
- Featured image thumbnail sometimes in content, sometimes changes header images
- Function to replace the url of featured images in the wordpress database?
- has_post_thumbnail gives always TRUE
- Displaying wordpress image size as array used for page builder
- Setting a default placeholder image WITHOUT link
- If I Regenerate Thumbnails, would WordPress delete the existing Thumbnails and replace them with ‘new copies’?
- how to use first post image as thumbnail on wordpress
- Make the first image the post thumbnail without setting it as the featured image
- offload media to external services [closed]
- Aligning the thumbnail image
- How do get post thumbnail into plugin?
- Default Featured Image from Post content
- upload or auto setup feature photo by user avatar
- How to create resized versions of images added with wp_insert_attachment
- Can I insert the feature image inside the content, after any paragraph?
- Set Post Thumbnails in Percents
- get_the_post_thumbnail() returns nothing?
- What can I do if I set a gif as featured image? no thumbnail when i share on facebook
- Can’t get post thumbnail to display in foreach loop
- Child Category Image
- Resizing thumbnails retrospectively
- Displaying caption with featured image
- add_theme_support post-thumbnails not working
- Trying to show WordPress category query result as background image
- How risize a thumbnail?
- custom thumbnail image size not working
- Assign SQL ‘post_thumbnail’ column as featured image
- Default thumb – how to set it
- How to update custom image sizes?
- featured images twenty eleven theme
- Picture inserted in the post not showing in “Gallery”
- featured image is not showing
- How to change the format of thumbnails into wordpress theme?
- How to create thumbnails programmatically?
- Usage of add_image_size (for featured image)
- Smaller Size for featured images
- Featured image doesn’t appear in Blog index
- Remove Featured Image based on Date
- How to show only 2nd featured img on home/blog
- Echo recent posts each with its own respective featured image
- How to get post thumbnail to be equal to set media size
- Add notice to add image popup
- Mass/Bulk assign featured images to posts
- setting featured image is not working while running script in background, works when running that script from browser
- How to modify responsive images in post thumbnails
- get_the_post_thumbnail() – Invalid argument supplied for foreach() in /wp-includes/post-thumbnail-template.php on line 64
- Different thumbnail size than actual picture in post
- How to get the featured image inside of a single-.php template?
- Where is the template from the_post_thumbnail()?
- Get Post Thumbnail Outside of Loop
- Theme:Twenty Fourteen, How to remove featured image on single post page for particular category
- Strange image artifact on font-page thumbnail image