[resolved] wp_get_attachment_image where the $attachment_id is whatever is attached to post (1 post)

  1. Eos Rose
    Posted 5 years ago #

    In my single.php template I have inserted the following code just to make sure I can make an image in a specific post display the way I want it to:

    <?php echo wp_get_attachment_image( 51, array(300,300) ); ?>

    Now I want to make it so that the $attachment_id is not always 51, but rather whichever $attachment_id is applicable to a specific post. I'm not sure how to do that... Could someone please point me in the right direction?

Topic Closed

This topic has been closed to new replies.

About this Topic