Is it possible set a featured image with external image URL

Yes, it’s possible and pretty easy. This is the workflow I suggest: Put somewhere a UI to insert the URL of the featured image. Probably best choice is to use ‘admin_post_thumbnail_html’ filter hook Use ‘save_post’ action hook to save the URL (after security and validation routine) in a custom post meta Use ‘post_thumbnail_html’ filter hook … Read more

Programmatically adding images to media library

$image_url=”adress img”; $upload_dir = wp_upload_dir(); $image_data = file_get_contents( $image_url ); $filename = basename( $image_url ); if ( wp_mkdir_p( $upload_dir[‘path’] ) ) { $file = $upload_dir[‘path’] . “https://wordpress.stackexchange.com/” . $filename; } else { $file = $upload_dir[‘basedir’] . “https://wordpress.stackexchange.com/” . $filename; } file_put_contents( $file, $image_data ); $wp_filetype = wp_check_filetype( $filename, null ); $attachment = array( ‘post_mime_type’ => … Read more

Image Upload from URL

you can write a php script, or make your own plugin of this code here, i used it in one of my projects where i had to import a large number of images. first, get the image, and store it in your upload-directory: $uploaddir = wp_upload_dir(); $uploadfile = $uploaddir[‘path’] . “https://wordpress.stackexchange.com/” . $filename; $contents= file_get_contents(‘http://mydomain.com/folder/image.jpg’); … Read more

WordPress Theme Preview Image

There is no automatic preview. You need to create the screenshot yourself and place it in the theme/child theme folder named screenshot.png The recommended image size (currently) is 1200px wide by 900px tall, however the screenshot will only be shown as 387×290. It is over-sized to allow for high-resolution viewing on HiDPI displays. Note that … Read more

tech