Displaying specific posts from query thumbnail outside div October 20, 2022 by Tarik Billa the_post_thumbnail will echo it, You should Use get_the_post_thumbnail instead to return image.