1

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>';
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

| improve this answer | |
  • yes I have tried that, but still i am getting the full size image.. – Joanna Mikalai Jul 22 '17 at 9:55
  • Sure you editing the right code? @joanna-mikalai – DGRFDSGN Dec 5 '18 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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