thumb_src function
$post to $query
Replace postID query with: $query->post->ID