Title: [Plugin: Multiple Post Thumbnails] Use outside the loop?
Last modified: August 19, 2016

---

# [Plugin: Multiple Post Thumbnails] Use outside the loop?

 *  [takeok](https://wordpress.org/support/users/takeok/)
 * (@takeok)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-multiple-post-thumbnails-use-outside-the-loop/)
 * I need to be able to display secondary images outside the loop. More specifically,
   I need to be able to get the image URL(s) from outside the loop. Is that possible?
   the_post_thumbnail() only works inside the loop. I tried to use get_the_post_thumbnail()(
   it accepts a post ID as an argument so it can be used outside the loop) but the
   plugin doesn’t work with get_the_post_thumbnail(). Any ideas?

Viewing 1 replies (of 1 total)

 *  Thread Starter [takeok](https://wordpress.org/support/users/takeok/)
 * (@takeok)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-multiple-post-thumbnails-use-outside-the-loop/#post-1818306)
 * Answering my own question, I went into the database and noticed that the featured
   images are just post attachments. So something along these lines may be the right
   place to start?
 *     ```
       <?php
       	$args = array(
       		'post_type' => 'attachment',
       		'numberposts' => -1,
       		'post_status' => null,
       		'post_parent' => $post->ID,
       		'orderby' => 'menu_order',
       		'order' => 'ASC',
       		'post_status' => NULL
       	);
       	$attachs = get_posts($args);
       	if (!empty($attachs)) {
       		foreach( $attachs as $att ) {
       			echo wp_get_attachment_image($att->ID,'post-thumbnail');
       		}
       	}
       ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Multiple Post Thumbnails] Use outside the loop?’ is closed to
new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [takeok](https://wordpress.org/support/users/takeok/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-multiple-post-thumbnails-use-outside-the-loop/#post-1818306)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
