title: wp_get_attachment_image not working wordpress to show blog post image
body: <p>I am using wordpress and trying to create a blog landing page to show the most recent blog posts. So far so good but I am having difficulties showing the blog image in the image tag. I am able to obtain the postId by using <code>get_the_id</code> function. I was also able to get the date of the post by using <code>the_date</code> function. </p>
  
  <p>However, I cannot get the <code>wp_get_attachment_image</code> function to show the image of the blog post.</p>
  
  <p>Please see my code below.</p>
  
  <pre><code>&lt;?php $query = new WP_Query( 'posts_per_page=5' ); ?&gt; 
  
  &lt;?php while ($query -&gt; have_posts()) : $query -&gt; the_post(); ?&gt;
      &lt;div class="blog"&gt;
        &lt;img src="wp_get_attachment_image( get_the_ID() ); "&gt;
        &lt;h3&gt;&lt;a href="&lt;?php the_permalink() ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
        &lt;p&gt;&lt;?php the_date(); ?&gt;&lt;/p&gt;
        &lt;p&gt;&lt;?php the_excerpt(__('(more…)')); ?&gt;&lt;/p&gt;
      &lt;/div&gt;
  
      &lt;?php
          endwhile;
          wp_reset_postdata();
      ?&gt;
  </code></pre>