media_handle_sideload
handles the uploads in the same way the normal upload does. That means, when you upload a remote image (YouTube thumbnails in your case) it will automatically create the thumbnails of sizes registered using add_image_size
.
So, what you need to do is create a thumbnail of desired size and call it in your loop.
function my_setup() {
//Support Thumbnails
add_theme_support( 'post-thumbnails' );
//Add Thumbnail Sizes
add_image_size( 'youtube', 224, 120, true );
}
add_action( 'after_setup_theme', 'my_setup' );
And then in your loop;
if ( '' != get_the_post_thumbnail() ) {
the_post_thumbnail( 'youtube' );
}
Related Posts:
- Differentiate Featured Image from Post Images upon Upload
- using media uploader to select image of specific size, enforce cropper
- Media Gallery Upload photo incorrect way like glitch
- Upload featured image from front end using media-upload.php
- Removing extra large generated images disables all crops
- Set featured link not showing
- How to Fix HTTP Error When Uploading Images?
- How to add new tab to media upload manager with custom set of images?
- No Thumbnails Generated
- Extend Media Library
- Reject upload of wrong-sized images using the Media Uploader
- How to show all available images in WP’s media library when using the Polylang plugin?
- How to add a custom field to the media screen (image/gallery)?
- Saving Media – Which Hook is Fired?
- upload_async.php returns 500 error
- Which filters or actions to use after a media upload and delete?
- Protecting direct access to PDF and ZIP unless user logged in (without plugin)
- Set a maximum upload count for users on a specific user role
- Refresh wp.media after ajax call
- Multisite, upload images directly to Amazon S3
- wp_editor with media buttons
- Force wordpress to see uploads folder media
- Append button to WordPress Image Details modal
- Convert uploaded PNG to JPEG automatically
- Disable TinyMCE Drag and Drop
- WP3.5 Media Uploader – how to make it accept multiple images?
- Upload image from a URL and assign it as a Featured Image to a Custom Post Type?
- Setting wp_temp_dir and permissions not working for “Missing A Temporary Folder” error
- wp_temp_dir does not change the /tmp temporary default directory
- Retrieving JSON data in ajax request from media uploader
- Maximum upload size changes in php.ini ignored – How to remove upload size limit?
- How to disable WordPress Media resize different size version?
- insert post & Upload post thumbnail from the front end using ajax
- Media library storing files in uploads not folders within in uploads
- How to side load an image from a service
- Media handle sideload not working
- Regenerate thumbnails unexpected resolution (96 x 96)
- How to overwrite wp_unique_filename logic
- How to change upload directory based on frontend form input name or ID?
- How to host different file formats/types for a media attachment without creating multiple attachments?
- How to delete uploads not in media library?
- Change default from “Attachment post URL” to “File URL” in Add Media
- Why does SVG upload in Media Library fail if the file does not have an XML tag at the beginning?
- media_handle_upload : undefined function?
- Site icons with alpha channel for self-hosted WordPress blog network
- Cannot upload .mp3 file to wordpress media
- Using subdomain to upload media/images etc on 2 different blogs
- WordPress suddenly starts uploading media to an old (backdated) folder
- Why would media_sideload_image() not work locally?
- XML-RPC: How to add media caption to uploaded image?
- Restrict WordPress Media Library for a specific user role (users can only see/select own media)
- Can I change the URL of a video, or upload a video to a specific URL?
- Convert (-) and (escape) signs to (_) when uploading files on wordpress media library automatically
- Move files from flat upload directory to organised by year / month
- Using wp_enqueue_media() with switch_to_blog() issue
- Can’t manipulate media uploads
- Media library only shows for admin. Doesn’t show editor or below [closed]
- What relationship determines which images appear in ‘uploaded to post’ in edit/add post media dialog
- Capability to prevent upload of files
- Custom media uploader not showing library
- How can I manage and limit disk usage for each author?
- How can I modify the media upload form fields?
- A link (not in the post) to download a specific PDF file
- How does wordpress handle media files?
- upload_max_size doesn’t change
- What is the URL pattern for image thumbnails + sizes?
- limit media upload to once a day
- Add SWF file to wordpress through custom template
- Control resizing of uploaded images
- Do custom post type (CPT) attachments/media store the parent post ID?
- How to change Route respond To A specific Path?
- WordPress media has all disappeared on wp-admin but still on the server
- Missing a temporary folder not fixed
- How to remove media by filename?
- media_handle_upload() returns Specified file failed upload test
- WP media upload issues
- Is there some way to find if media items are used anywhere on the site?
- Media uploads error
- Media URL slugs without uploads folder path
- Frontend media shows “An error occurred in the upload. Please try again later.”
- Moving wp-content folder to public_html
- WP_Custom_Media_Control | Give ID to media file
- How can i link my featured image to be clicked and the file will be downloaded
- WP Add Media Button – Can I set the default size to Original/Full Size
- Redimension thumbnail crop without creating new images
- wp.media – media uploader – how to destroy instance of modal?
- Featured image to grayscale with PHP imagefilter – which hook to use?
- Issues with WordPress 3.9.6 media libraries on XAMPP
- Force relative path in media library for LAN deployment
- Used Duplicator to transfer a site. Now my media uploads aren’t working
- Theme stops media uploader from working
- How to split my uploaded media into directories?
- get the post thumbnail returns the full size
- All files unattached in Media Library
- WordPress media upload multiple images
- Is it possible to upload multiple images via Media Library tab in Thickbox I’ve created?
- Make thumbnail from uploaded image without plugin
- How to upload an image using media uploader and return the image link to javascript?
- Is there a way to force Featured image to show as attachement?
- Image in binary in the data to WordPress media library