1

I'm currently writing a plugin modifying the post content with the wp_insert_post_data filter. While doing that I would also like to add a post thumbnail using an external image url. It doesn't really matter if the image is hotlinked or copied to my wordpress installation. Anyone knows how to go about that?

3 Answers 3

1

you should have a look to this blog post : http://www.maverick.it/tech/create-thumbnails-using-wordpress-built-in-functions

then, if you can't use a remote image, just download it as a temporary file on your server, process and delete it.

One your image created, you should then insert it as an attachment (http://codex.wordpress.org/Function_Reference/wp_insert_attachment) and set it as the post thumbnail (http://codex.wordpress.org/Function_Reference/set_post_thumbnail)

I hope it will help.

Cyril.

0

This may help?

http://epicplugins.com/external-url-link-to-featured-images/

It's a plugin that lets you set your featured image from an external image URL.

-1

Hotlinkig is inherently evil.

Just host the images on your own server. Use WordPress built-in Media Management to attach the images to your posts, and to designate them as featured images (i.e. post thumbnails).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.