Title: Featured Image Shortcode Problem
Last modified: August 20, 2016

---

# Featured Image Shortcode Problem

 *  Resolved [kanika](https://wordpress.org/support/users/kanikawordpresscom/)
 * (@kanikawordpresscom)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/featured-image-shortcode-problem/)
 * Hi,
 * I am using the following plugin:
 * [http://wordpress.org/extend/plugins/featured-image/](http://wordpress.org/extend/plugins/featured-image/)
 * As per the documentation I tried using:
 *     ```
       <?php
       					$args = array('category' => 7, 'posts_per_page' => -1);
       					$custom_posts = get_posts($args);
       					foreach($custom_posts as $current_post):
       					setup_postdata($current_post);
   
       				?>
                       <div class="bookImage"><?php echo do_shortcode("[featured-img]"); ?></div>
       				<hr/>
                       <?php
       				endforeach;
       				?>
       ```
   
 * in my template file.
 * But it does not work

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/featured-image-shortcode-problem/#post-3020807)
 * you would not need the shortcode in your situation;
 * try directly:
 *     ```
       <div class="bookImage"><?php echo get_the_post_thumbnail($current_post->ID,'single-post-thumbnail'); ?></div>
       ```
   
 *  Thread Starter [kanika](https://wordpress.org/support/users/kanikawordpresscom/)
 * (@kanikawordpresscom)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/featured-image-shortcode-problem/#post-3020838)
 * Thank you so much. It worked.
 * Just one last question: When we use this plugin, the featured image association
   is added somewhere in the database?
 * If so, where?
 * Thanks for the soln again. It came on time.
 * Kanika.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/featured-image-shortcode-problem/#post-3020841)
 * > When we use this plugin, the featured image association is added somewhere 
   > in the database?
 * the plugin only helps to output the featured image – it does not influence where
   the image information is stored.
 * when you set a featured image for a post or page, the featured image ID is saved
   in the database as a (hidden) custom field with the meta key `'_thumbnail_id'`
 *  Thread Starter [kanika](https://wordpress.org/support/users/kanikawordpresscom/)
 * (@kanikawordpresscom)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/featured-image-shortcode-problem/#post-3020846)
 * Thank you so much

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

The topic ‘Featured Image Shortcode Problem’ is closed to new replies.

## Tags

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

 * 4 replies
 * 2 participants
 * Last reply from: [kanika](https://wordpress.org/support/users/kanikawordpresscom/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/featured-image-shortcode-problem/#post-3020846)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
