include w_thumbnail_src in function?

You can just update your function to pass the post_id as a parameter.

function w_thumbnail_src($post_id) {
    if (has_post_thumbnail($post_id)) {
        $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'emphasis');
       echo $thumb[0]; // thumbnail url
    }
}