Correct way of using wp_get_attachment_image() in wordpress

The function wp_get_attachment_image only gets an image that was uploaded to wordpress, it doesn’t output an image in the content of the post.

You have to output the content of the post for your example image.

Like: echo $attachments['post_content'];

Leave a Comment