Each post of my blog has a Custom Field which is the URL of a photo on Flickr. How can I use it as the Featured Image?
Please note I'm asking this question because I'm migrating to a theme that makes use of the Featured Image to display thumbnails on the blog’s home page, but I would avoid enter them all by hand for all the 300+ old posts.
- I'd prefer to avoid to change the theme's code, to avoid complications during future updates. But I can use child themes.
The theme I'm using uses the
get_post_thumbnail_id()function to obtain the featured image attached to the post:
<?php if ( has_post_thumbnail() ) : $full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' ); ?> <div class="post-thumbnail-wrapper"> <a class="swipebox" href="<?php echo $full_image_url; ?>" title="<?php printf( esc_attr__('Permalink to image of %s', 'envirra'), the_title_attribute('echo=0') ); ?>" rel="bookmark"> <?php the_post_thumbnail( 'vw_large' ); ?> </a> </div>