Want to get the thumbnail from a WP_Post object? The following is just a proof of concept in form of shortcode. It dumps a code block with all posts that have a Featured Image.
Function reference: has_post_thumbnail(), get_the_post_thumbnail()
add_shortcode( 'all-post-thumbs', 'so_14007170_dump_post_thumbs' );
function so_14007170_dump_post_thumbs( $atts, $content )
$posts = get_posts( array(
'post_type' => 'post',
'numberposts' => -1,
'post_status' => 'publish'
// Build an array of post thumbnails
$thumbs = array();
foreach( $posts as $post)
if( has_post_thumbnail( $post->ID) )
$thumbs = array( $post->post_title, htmlentities(get_the_post_thumbnail( $post->ID ) ) );
// Build output and return
$echo = '<pre>'. print_r( $thumbs, true ) . '
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.