Title: [Plugin: Display Posts Shortcode] Hacking the thumbnail output
Last modified: August 20, 2016

---

# [Plugin: Display Posts Shortcode] Hacking the thumbnail output

 *  Resolved [designblogg](https://wordpress.org/support/users/designblogg/)
 * (@designblogg)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-hacking-the-thumbnail-output/)
 * Hi
 * I am modifying this plugin to output results “correctly” for my site.
    Most of
   it is working like a charm, only the thumbnail is giving me issues.
 * `if ( $image_size && has_post_thumbnail() ) $image = '<a class="contentrotator-
   thumb" href="'. get_permalink() .'">'. get_the_post_thumbnail($post->ID, $image_size).'
   </a> ';`
 * I am trying to create this as a normal IMG SRC, not a link, but then it all just
   falls down like a house of cards.
 * code I an trying to use is
 * `if ( $image_size && has_post_thumbnail() ) $image = '<img class="contentrotator-
   thumb" src="'. get_the_post_thumbnail().'" />';`

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

 *  Thread Starter [designblogg](https://wordpress.org/support/users/designblogg/)
 * (@designblogg)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-hacking-the-thumbnail-output/#post-2572455)
 * I have btw also tried it with the following without any luck
 * `if ( $image_size && has_post_thumbnail() ) $image = '<img class="contentrotator-
   thumb" src="'. get_the_post_thumbnail($post->ID, $image_size).'">''</img> ';`
 *  Thread Starter [designblogg](https://wordpress.org/support/users/designblogg/)
 * (@designblogg)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-hacking-the-thumbnail-output/#post-2572464)
 * Looking over the source from FF, I see the `get_the_post_thumbnail` argument 
   creates an IMG SCR output automatically, question then is, where do I edit the
   output of this?
 *  Thread Starter [designblogg](https://wordpress.org/support/users/designblogg/)
 * (@designblogg)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-hacking-the-thumbnail-output/#post-2572494)
 * figured out a solution by editing the image output in href rather than removing
   the href alltogether
 *  [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * (@billerickson)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-hacking-the-thumbnail-output/#post-2572554)
 * If you want the image URL without the full image tag, do something like this:
 * $image_array = wp_get_attachment_image_src( get_post_thumbnail_id(), $image_size);
   
   $image = ‘<img src=”‘ . $image_array[0] . ‘” />’;

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

The topic ‘[Plugin: Display Posts Shortcode] Hacking the thumbnail output’ is closed
to new replies.

## Tags

 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)

 * 4 replies
 * 2 participants
 * Last reply from: [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-hacking-the-thumbnail-output/#post-2572554)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
