WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If anyone can help me I would be gratefull!

I got a gravity form with the post_type fields including the submit image when submited it displays the:

  • title
  • content
  • image
  • tags

So my question is:

When I go to single.php I posted a code: get_related_author_posts(); which calls the authors last two posts in function.php.

Please take a look at the code, that contains/illustrates the problem: http://pastie.org/1926079

I need a little help from my friends the wordpress gurus :)

Thank You all in advance. I'm still learning the more advanced functions but this is where I'm stuck:)

share|improve this question
I edited your Q for readability. – kaiser May 19 '11 at 12:20
up vote 2 down vote accepted

I would use wp_get_attachment_image() (Codex ref), which returns a fully-formed HTML IMG tag:

wp_get_attachment_image( $attachment_id, $size, $icon ); 

I assume you already know how to get the attachment image ID?

The default image size is thumbnail, but you can pass any standard image size (e.g. full, large, medium), or any custom image size added via add_image_size().

share|improve this answer

You can find all the functions you need here (see "Related" at the bottom).

share|improve this answer
I'm lost, still can't get the image to be previews. I'll try harder :D – jimilesku May 19 '11 at 18:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.