Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
1  
I edited your Q for readability. –  kaiser May 19 '11 at 12:20
add comment

2 Answers

up vote 2 down vote accepted

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

<?php 
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
add comment

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
add comment

Your Answer

 
discard

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.