title: update_post_meta not working in wordpress
body: <p>I have a bit of code in my functions file that is looping over posts and then adding together facebook and google plus likes for the post and storing the value in the post meta, however it has only saved the value in the post_meta once - it is not updating! </p>
  
  <p>What is my problem here, why is it not updating?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>$the_query = new WP_Query( $args );
  
  while ( $the_query-&gt;have_posts() ) : $the_query-&gt;the_post();
  
  // Get Facebook Likes From FB Graph API
  $data = file_get_contents('http://graph.facebook.com/?id='. get_permalink());
  $obj = json_decode($data);
  $like_no = intval($obj-&gt;{'shares'});
  
  $html =  file_get_contents( "https://plusone.google.com/_/+1/fastbutton?url=".urlencode(get_permalink()));
      $doc = new DOMDocument();   $doc-&gt;loadHTML($html);
      $counter=$doc-&gt;getElementById('aggregateCount');
      $google_no = $counter-&gt;nodeValue;
  
     $shares_total = $like_no + $google_no;
  
  // Add Facebook Likes to Post Meta
  update_post_meta(get_the_ID(), '_mn_fb_likes', $shares_total);
  
  endwhile;
  wp_reset_postdata();
  }
  </code></pre>