title: Code broken in a particular order
body: <p>I have been a designer by trade for years however I am working with WordPress for a client and have been managing to get by with working with hooks... I am, however now at a standstill.</p>
  
  <p>On the homepage I have two areas which will be pulling information from the database:</p>
  
  <pre><code>&lt;?php 
      $thumb_posts = get_posts(array('category' =&gt; '6', 'orderby' =&gt; 'rand', 'numberposts' =&gt; 2, 'meta_key' =&gt; '_thumbnail_id' ));
  if($thumb_posts) { ?&gt;
  &lt;?php foreach( $thumb_posts as $post ) {
  echo '&lt;div class="feature"&gt;&lt;div class="thumbnail"&gt;
  &lt;a href="' . get_permalink($header_thumb-&gt;ID) . '"&gt;' . get_the_post_thumbnail($header_thumb-&gt;ID,array(240,170)) . '&lt;/a&gt;&lt;/div&gt;';
  $url = get_permalink($post-&gt;ID);
  $filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $url);
  $json = json_decode($filecontent);
  $count = $json-&gt;$url-&gt;comments;
  if ($count == 0 || !isset($count)) {
  $count = '0';
  } elseif ( $count == 1 ) {
  $count = '1';
  } else {
  $count .= '';
  }
  echo '&lt;h3 class="title"&gt; &lt;a href="' . get_permalink($header_thumb-&gt;ID) . '#comments"     class="comments"&gt;' . $count . '&lt;/a&gt; &lt;a href="' . get_permalink($header_thumb-&gt;ID) . '"&gt; ' . get_the_title($ID) . ' &lt;/a&gt; &lt;/h3&gt;&lt;/div&gt;';
  } ?&gt;
  </code></pre>
  
  <p>Which I did not write, but calls the facebook comment count of the random post with title and thumbnail.</p>
  
  <p>Here is my problem... Once I place my second code AFTER this it throws off the count/image retrieval. However, if I place this code BEFORE everything works great.</p>
  
  <pre><code>&lt;?php 
  $thumb_posts = get_posts(array('category' =&gt; '6', 'orderby' =&gt; 'rand', 'numberposts' =&gt; 2, 'meta_key' =&gt; '_thumbnail_id' ));
  if($thumb_posts) { 
  ?&gt;
  
  &lt;?php 
  global $post;
  $myposts = get_posts('numberposts=20');
  foreach($myposts as $post) :
  ?&gt;
  &lt;li&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt; | 
  &lt;span class="post-info"&gt; &lt;?php echo human_time_diff( get_the_time('U'),
  current_time('timestamp') ) . ' ago'; ?&gt; &lt;/span&gt;&lt;/li&gt;
  &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>In my thought process, I need to somehow make it so the second code doesn't somehow throw off the first independent code.</p>