How to store the_post_thumbnail() value in a variable

With a tiny bit of research, I’m pretty sure you could have created this yourself: $featimage = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘full’ )[0]; $printable_url=”<img src=”” . $featimage . ‘”>’; echo $printable_url; Edit: Since PHP 5 is defunct, you can reference the first node in the array ([0]) directly. No need for intermediate storage of the full array.