Support » Fixing WordPress » wp_get_attachment_image where the $attachment_id is whatever is attached to post

  • Resolved Rose


    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?

  • The topic ‘wp_get_attachment_image where the $attachment_id is whatever is attached to post’ is closed to new replies.