title: get_post_meta in WP_Query
body: <p>I'm doing a plugin to add likes to posts</p>
  
  <p>I want to create a table on a page in the plugin to show each post and the number of likes</p>
  
  <pre><code>function my_plugin_options() {
  
      echo '&lt;p&gt;Table of Likes&lt;/p&gt;';
      echo '&lt;/div&gt;';
  
      echo '&lt;table&gt;';
    echo '&lt;tr&gt;';
    echo '&lt;td&gt;Post&lt;/td&gt;';
    echo '&lt;td&gt;Number of likes&lt;/td&gt;';
    echo '&lt;/tr&gt;';
  
      $like_args = array(
          'post_type' =&gt; 'post',
          'order' =&gt; 'DES',
          'post_status' =&gt; 'publish'
      );
  
      $like_loop = new WP_Query($like_args);
  
      if($like_loop-&gt;have_posts()):
          while($like_loop-&gt;have_posts()):
              $like_loop-&gt;the_post();
  
      $likes = get_post_meta( $like_loop-&gt;post_ID, "_like_amount", true);     
  
      echo '&lt;tr&gt;';
      echo '&lt;td&gt;';
      the_title();
      echo '&lt;/td&gt;';
      echo '&lt;td&gt;';
      $likes;
      echo '&lt;/td&gt;';
      echo '&lt;/tr&gt;';
  
      endwhile;
      endif;
  
      wp_reset_postdata();
  
      echo '&lt;/table&gt;';
  }
  </code></pre>
  
  <p>I have a meta field in each post '_like_amount' that is the number of likes.</p>
  
  <p>How do I use this meta field in my WP_Query.</p>
  
  <p>I've tried </p>
  
  <pre><code>$likes = get_post_meta( $like_loop-&gt;post_ID, "_like_amount", true);
  </code></pre>