get_the_post_thumbnail_url does not return anything if image size is set
The first parameter for get_the_post_thumbnail_url() is the post ID or post object, and not the image size which is actually the second parameter. So: // Instead of this: get_the_post_thumbnail_url( ‘thumbnail’ ) // You should use: get_the_post_thumbnail_url( get_the_ID(), ‘thumbnail’ ) // pass a post ID get_the_post_thumbnail_url( get_post(), ‘thumbnail’ ) // or post object // Or you … Read more