Title: [Plugin: Multiple Post Thumbnails] Two Errors in get_the_post_thumbnail function
Last modified: August 20, 2016

---

# [Plugin: Multiple Post Thumbnails] Two Errors in get_the_post_thumbnail function

 *  Resolved [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-multiple-post-thumbnails-two-errors-in-get_the_post_thumbnail-function/)
 * two issues with the parameters in the get_the_post_thumbnail function
 *     ```
       get_the_post_thumbnail($post_type, $thumb_id, $post_id = NULL, $size = 'post-thumbnail', $attr = '' , $link_to_original = false)
       ```
   
 * first: the default size is ‘post-thumbnail’. i don’t believe there IS a size 
   called ‘post-thumbnail’. the smallest, thumbnail size is simply called ‘thumbnail’
 * second: the $post_id is null by default. in the example on the plugin page you
   pass this parameter as NULL, I suppose presumably b/c the $post_id will be automatically
   set to the current post by default. except this doesn’t happen.
 *     ```
       global $id;
       $post_id = (NULL === $post_id) ? $id : $post_id;
       ```
   
 * this $id variable has no value, so if you don’t pass get_the_ID() in as the post
   ID parameter, you will not get an image.
 * seems like this should be:
 *     ```
       global $post;
       $post_id = (NULL === $post_id) ? $post->ID : $post_id;
       ```
   
 * [http://wordpress.org/extend/plugins/multiple-post-thumbnails/](http://wordpress.org/extend/plugins/multiple-post-thumbnails/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Chris Scott](https://wordpress.org/support/users/chrisscott/)
 * (@chrisscott)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-multiple-post-thumbnails-two-errors-in-get_the_post_thumbnail-function/#post-2585056)
 * Thanks for the feedback.
 * The default size is the same as WP’s `the_post_thumbnail()` uses.
 * For the $post_id, I could’ve sworn I lifted that from `get_the_post_thumbnail()`
   but it looks like I didn’t. This is fixed in version 1.0. Thanks!

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Multiple Post Thumbnails] Two Errors in get_the_post_thumbnail
function’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/multiple-post-thumbnails_d94965.svg)
 * [Multiple Post Thumbnails](https://wordpress.org/plugins/multiple-post-thumbnails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/multiple-post-thumbnails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/multiple-post-thumbnails/)
 * [Active Topics](https://wordpress.org/support/plugin/multiple-post-thumbnails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/multiple-post-thumbnails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/multiple-post-thumbnails/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Chris Scott](https://wordpress.org/support/users/chrisscott/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-multiple-post-thumbnails-two-errors-in-get_the_post_thumbnail-function/#post-2585056)
 * Status: resolved