Image size highlighted in wordpress

0

I have a loop that pulls the highlighted image from the post, I pull the image using get_the_post_thumbnail_url() , I tried get_the_post_thumbnail_url('thumbnail') but it gives error, I need to get the image in smaller size, only warning that get_the_post_thumbnail_url() img comes in full size!

    
asked by anonymous 20.10.2016 / 19:40

1 answer

1

get_the_post_thumbnail () accepts the size as the second parameter. The first is post_id

get_the_post_thumbnail_url( $post->ID, 'post-thumbnail') should resolve

Addendum : Both post id and size are optional, and thumb is the default size. So in fact if calling without parameters is bringing big image your problem may be in generation of thumbs, at the time of upload. have you checked if the reduced images are in the uploads folder?

    
20.10.2016 / 22:04