title: Add a custom field value for all of an Author's posts
body: <p>I'm trying to add a custom field value for all of each author's posts and display it on the author's profile page. </p>
  
  <p>I have a Like button function I created where when a user likes a post it adds +1 to post custom field <code>_post_like_count</code> so if a post has 10 likes the value in <code>_post_like_count</code> is 10. </p>
  
  <p>What I'm looking to do is take all of each author's posts add up the total likes they have for all their posts combined so if they have 5 posts that each have 10 likes each the total value should be 50. </p>
  
  <pre><code>$author_posts = get_posts( array('author' =&gt; $author-&gt;ID) ); // Author's ID
  $total_like_count = 0; // needed to collect the total sum of likes
  foreach ( $author_posts as $post ) {
      $likes = absint( get_post_meta( $post-&gt;ID, '_post_like_count', true ) );
  $total_like_count += $likes;
  }
  </code></pre>
  
  <p>This is the php I"m using which I thought should work and it does for some of the authors it appears but not for others, as I have some author's that should have 1000+ likes and it displays 77, where if an author has just 1 post with 17 likes it will display that properly. </p>
  
  <p>For a little about what I"m trying to do on the top line I'm getting the post author's ID, then I run the foreach to get each post and store the meta field value in $likes variable and then calculate it up in the bottom line in the $total_like_count which should be the number of all the likes for the author's posts combined. </p>