2

My theme is using this code in a shortcode to get the image of the post. However, this is the full size image and i am looking to get the small thumbnail instead. How could I do this?

   $image_output       = '<div class="x-recent-posts-img">' . get_the_post_thumbnail( get_the_ID(), 'entry', NULL ) . '</div>';

1 Answer 1

2

Just change the code to:

$image_output = '<div class="x-recent-posts-img">' . get_the_post_thumbnail( get_the_ID(), 'thumbnail', NULL ) . '</div>';

See in the Codex:

Thumbnail Sizes

get_the_post_thumbnail

2
  • yes I have tried that, but still i am getting the full size image..
    – JoaMika
    Commented Jul 22, 2017 at 9:55
  • Sure you editing the right code? @joanna-mikalai
    – DGRFDSGN
    Commented Dec 5, 2018 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.