Title: [Plugin: WordPress Popular Posts] Adding attached image to thumbnail
Last modified: August 19, 2016

---

# [Plugin: WordPress Popular Posts] Adding attached image to thumbnail

 *  [andyaa](https://wordpress.org/support/users/andyaa/)
 * (@andyaa)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-adding-attached-image-to-thumbnail/)
 * hey guys
 * I use the Simple Post Thumbnail plugin for my thumbnails and images [http://wordpress.org/extend/plugins/simple-post-thumbnails/installation/](http://wordpress.org/extend/plugins/simple-post-thumbnails/installation/)
 * I was wondering if anyone knew how I can use that plugins function inside the
   popular posts plugin
 * I am fairly good with code and know how to hack most plugins but cant get this
   one
 * This is the code I am currently using to call my thumbnails:
 * <?php } ?> ‘
 * I want to be able to add that code into the thumbnail section of wordpress-popular-
   posts.php line 650
 * If anyone could help it would be greatly appreciated
 * Thanks
 * Andy
 * [http://wordpress.org/extend/plugins/wordpress-popular-posts/](http://wordpress.org/extend/plugins/wordpress-popular-posts/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [andyaa](https://wordpress.org/support/users/andyaa/)
 * (@andyaa)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-adding-attached-image-to-thumbnail/#post-1467657)
 * The code got a little messed up
 * Here it is again
 * `<?php if ( p75HasThumbnail($post->ID) ) { ?><img src="<?php echo p75GetThumbnail(
   $post->ID, 215, auto); ?>" alt="<?php the_title(); ?>" class="thumb" /><?php }?
   >`
 *  [Héctor Cabrera](https://wordpress.org/support/users/ikki24/)
 * (@ikki24)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-adding-attached-image-to-thumbnail/#post-1467863)
 * Been trying to figure out this one with no luck.
 * This thumbnail plugin seems to use custom fields to retrieve the right image 
   from each post but for some reason can’t get it to work on my blog. Even tried
   to reach the plugin’s documentation page but the domain name seems to have expired
   or something, so no luck there either.
 * Maybe this can help you get started:
 * Change:
 * > `if ($instance[‘thumbnail’][‘active’] && $this->thumb ) {
   >  // WPP original 
   > code here }`
 * … into:
 * > if ($instance[‘thumbnail’][‘active’] && $this->thumb ) {
   >  if ( p75HasThumbnail(
   > $wppost->ID) ) { $thumb = ‘<img src=”‘. p75GetThumbnail($wppost->ID, 215, auto).'”
   > alt=”‘. get_the_title($wppost->ID) .'” class=”thumb” />’; } else { $thumb =”;}}

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: WordPress Popular Posts] Adding attached image to thumbnail’
is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [Héctor Cabrera](https://wordpress.org/support/users/ikki24/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-adding-attached-image-to-thumbnail/#post-1467863)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
