title: Set_post_thumbnail not working on Single Page, WordPress
body: <p>WordPress Codex states usage for 'set_post_thumbnail' is as followed:</p>
  
  <pre><code>&lt;?php set_post_thumbnail( $post_id, $thumbnail_id ); ?&gt;
  </code></pre>
  
  <p>On the single-page.php I am working in, I have the following code snippets</p>
  
  <pre><code>$post_id = get_the_ID();
  // Returns the ID of the current post
  </code></pre>
  
  <p>And</p>
  
  <pre><code>$thumb_url2 = mpp_media_src( 'full' );
  $thumb_url = $thumb_url2[0];
  //Returns the full URL path of first MediaPress image.
  </code></pre>
  
  <p>&amp; Lastly I have the following function in my functions.php file.</p>
  
  <pre><code>function get_attachment_id_from_src ($image_src) {
  global $wpdb;
  $query = "SELECT ID FROM {$wpdb-&gt;posts} WHERE guid='$image_src'";
  $id = $wpdb-&gt;get_var($query);
  return $id;
  }
  </code></pre>
  
  <p>Along with the following back on my single-page</p>
  
  <pre><code>$thumb_id = get_attachment_id_from_src($thumb_url);
  </code></pre>
  
  <hr>
  
  <p>A test of </p>
  
  <pre><code>echo $post_id;
  </code></pre>
  
  <p>returns </p>
  
  <pre><code>3544
  </code></pre>
  
  <p>which is the correct post id number.</p>
  
  <p>A test of </p>
  
  <pre><code>echo $thumb_url;
  </code></pre>
  
  <p>returns the image url </p>
  
  <pre><code>http://localhost/mydomain/wp-content/uploads/mediapress/members/374/3535/ATOMS-FOR-PEACE2.jpg
  </code></pre>
  
  <p>which is the correct image url.</p>
  
  <p>A test of</p>
  
  <pre><code>echo $thumb_id;
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>1627
  </code></pre>
  
  <p>Which is the correct thumbnail id.</p>
  
  <hr>
  
  <p>So why, I am wondering, after testing to make sure values in variables are proper and accurate, does inserting the following code seem to have no effect?</p>
  
  <pre><code>&lt;?php set_post_thumbnail( $post_id, $thumb_id ); ?&gt;
  </code></pre>