Title: Query Thumbnails?
Last modified: August 20, 2016

---

# Query Thumbnails?

 *  Resolved [haywars](https://wordpress.org/support/users/haywars/)
 * (@haywars)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/query-thumbnails/)
 * Currently I am display specific posts on a certain page like this:
 *     ```
       <?php
       $post_id=794;
       $queried_post = get_post($post_id);
       $title = $queried_post->post_title;
       ?>
       ```
   
 * How do i make it query the featured images as well?
 * I tried
 *     ```
       <span>
       <?php
       $post_id=792;
       $queried_post = get_post($post_id);
       $title = $queried_post->post_content;
       $post_thumbnail_id = get_post_thumbnail_id( $post_id );
       $thumb = $post_thumbnail_id->post_thumbnail;?>
       <?php echo $queried_post->post_content; ?></span>
       <li><?php echo $thumb; ?></li>
       ```
   
 * But that definitely doesn’t work.
 * `<?php the_post_thumbnail();?>`
 * That doesn’t work as well as I am querying specific posts and it has to tie into
   my first call. Any help?

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/query-thumbnails/#post-2658422)
 * `<?php echo get_the_post_thumbnail($post_id); ?>`
 * [http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail](http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail)
 *  Thread Starter [haywars](https://wordpress.org/support/users/haywars/)
 * (@haywars)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/query-thumbnails/#post-2658426)
 * I feel completely silly, thanks! You are a life saver!

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

The topic ‘Query Thumbnails?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [haywars](https://wordpress.org/support/users/haywars/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/query-thumbnails/#post-2658426)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
