Image size highlighted in wordpress

Asked

Viewed 824 times

0

I have a loop that pulls the highlighted image of the post, I pull the image using get_the_post_thumbnail_url(), tried get_the_post_thumbnail_url('thumbnail') but gives error, I need to get the image in smaller size, just warning that this way works get_the_post_thumbnail_url() but the img comes in large size!

  • try without this get, just try to the_post_thumbnail_url( 'thumbnail' )

  • @Pedrohenriquekuzminskas so it pulls the img in thumbnail size but gets out of the array I pull the img...

  • then do so the_post_thumbnail_url( array(100, 100) );, values of "100" Choose size.

  • no, the array is to create a json with the data I pull from wp...

1 answer

1


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

get_the_post_thumbnail_url( $post->ID, 'post-thumbnail') must solve

Addendum: Both post id and size are optional, and Thumb is the default size. So in fact if the call without parameters is bringing the big picture your problem may be in the generation of Thumbs, at the time of upload. already checked if the reduced images are in the uploads folder?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.