Title: Issue loading image within post.
Last modified: August 20, 2016

---

# Issue loading image within post.

 *  Resolved [mfux](https://wordpress.org/support/users/mfux/)
 * (@mfux)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/issue-loading-image-within-post/)
 * In my index page I use a function in order to call the associated image from 
   a post and display it as a thumb. However, when using the same code in the single
   page there is an issue, obviously the image is not stored in the directory of
   the post itself, rather the parent directory. However, upon searching I have 
   been unable to find a solution to load the image in the single page.
 * The code is below;
 * <img class=”large-image” src=”<?php $thumb = get_post_custom_values(‘post-image’);
   echo $thumb[0]; ?>” alt=”<?php the_title(); ?>” />
 * Any help is greatly appreciated. 🙂

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

 *  [Jason](https://wordpress.org/support/users/themeblvd/)
 * (@themeblvd)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/issue-loading-image-within-post/#post-2251678)
 * You’d probably want to be using post thumbnails (i.e. “Featured Image” when you’re
   editing a page/post). Is this what you’re talking about when you say you’re trying
   to show a thumb?
 * If so, then you can just show the post thumbnail like this within the loop of
   your page.php file:
 * `<?php the_post_thumbnail(); ?>`
 * Reference: [http://codex.wordpress.org/Function_Reference/the_post_thumbnail](http://codex.wordpress.org/Function_Reference/the_post_thumbnail)
 * Note, that in order to use this functionality, you must have support within your
   theme for post thumbnails.
 * Reference: [http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails](http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails)
 *  [Jason](https://wordpress.org/support/users/themeblvd/)
 * (@themeblvd)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/issue-loading-image-within-post/#post-2251687)
 * Sorry, just a note in what I said… I got confused when you referred to it as 
   a “page”, but I think you actually meant a “post” … So where I say “page.php”
   above, I meant “single.php”
 *  Thread Starter [mfux](https://wordpress.org/support/users/mfux/)
 * (@mfux)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/issue-loading-image-within-post/#post-2251714)
 * Marry me! Lol, thanks a lot. 🙂

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

The topic ‘Issue loading image within post.’ is closed to new replies.

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [mfux](https://wordpress.org/support/users/mfux/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/issue-loading-image-within-post/#post-2251714)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
