Featured video and image thumbnails from external links in WordPress

Is there a way to get a thumbnail from any website link? For example, if I take a link from imgur and post it on my website in the post itself, it shows the image. But when I go to the homepage of my website there is no featured image for that post. Just a great box. How could I generate a featured image of any link I posted from an external website?

I have used the video thumbnail plugin but it only works with certain websites.

Related posts

1 comment

  1. try going into page.php of your theme, then search for the_post_thmbnail(). There add the image link

    change this line:

    <?php the_post_thumbnail(); ?>
    

    to something like this:

    <?php $name = get_post_meta($post->ID, 'ExternalUrl', true);
    if( $name ) { ?>
    <a href="<?php echo $name; ?>"><?php the_post_thumbnail(); ?></a>
    <?php } else {
    the_post_thumbnail();
    } ?>
    

    hope this helps 🙂

Comments are closed.