Title: post thumbnail
Last modified: August 19, 2016

---

# post thumbnail

 *  Resolved [miocene22](https://wordpress.org/support/users/miocene22/)
 * (@miocene22)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/post-thumbnail/)
 * I want my blog template to have a layout where each post has an image that is
   posted alongside the excerpt. Much like [this site](http://hypebeast.com/).
 * I have tried the function `the_post_image();` and `the_post_thumbnail` in my 
   template but both give me this error:
 * > Fatal error: Call to undefined function the_post_image() in [thethemedirectory]\
   > blogpage.php on line 27
 * what am I doing wrong? This is the loop I made:
 *     ```
       <?php query_posts('category_name=websites&posts_per_page=10'); ?>
   
         <?php while (have_posts()) : the_post(); ?>
   
       		<div class="posthead">
       			<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?>
       			</a></h3>
   
       		</div><!-- /Posthead -->
       		<div class="entry">
       		 <div class="alignright"><?php the_post_image(); ?></div>
   
       			<?php the_excerpt(); ?></div><!-- /Entry -->
   
       				<p class="postmetadata">
       			<?php edit_post_link('Edit', '', ''); ?></p>
   
       	<?php endwhile; ?>
       ```
   
 * I assume just adding an image to a post by uploading it and adding it as a thumbnail
   make it the post image. If I’m worng how do you add a post image to a post?

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

 *  Thread Starter [miocene22](https://wordpress.org/support/users/miocene22/)
 * (@miocene22)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/post-thumbnail/#post-1319837)
 * Extra: having done some research I have added `add_theme_support('post-thumbnails');`
   to my functions.php which allows me to attach an image to my post but I still
   receive the same error when I visit the blog page
 *  Thread Starter [miocene22](https://wordpress.org/support/users/miocene22/)
 * (@miocene22)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/post-thumbnail/#post-1319842)
 * Figured it out….
 * Use `the_post_thumbnail()` `not the_post_image()`
 * hope this helps someone else…
 *  [hilj](https://wordpress.org/support/users/hilj/)
 * (@hilj)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/post-thumbnail/#post-1320156)
 * Yes it helped. Thanks a lot 🙂

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

The topic ‘post thumbnail’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [hilj](https://wordpress.org/support/users/hilj/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/post-thumbnail/#post-1320156)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
