title: Wordpress Network wp_get_attachment_url only gets first URL in a post loop
body: <p>I'm getting some really weird results trying to pull all the featured image URL's for a custom post type.</p>
  
  <p>Only the first URL will be pulled all others show blank. I have checked the post ID and it does have a value. Also the thumbnail ID is pulling correctly. If I place that value into the function hardcoded it will return the proper URL this is in a theme page. Here is the code:</p>
  
  <pre><code>global $post;
                  $type = 'slider';
                  $args=array(
                    'post_type' =&gt; $type,
                    'post_status' =&gt; 'publish',
                    'posts_per_page' =&gt; 5 );
  
                  $slider_posts = null;
                  $slider_posts = new WP_Query($args);
                  while ($slider_posts-&gt;have_posts()) {
                      $slider_posts-&gt;the_post(); 
                      $post_id = $post-&gt;ID;
                      $thumbnail_id = intval(get_post_thumbnail_id( $post_id ));
  
                      if ( has_post_thumbnail()) {
                          $url = wp_get_attachment_url( $thumbnail_id );
                          ?&gt;
  
                      &lt;div class="slide"&gt;
                          &lt;img class="slider_images" src="&lt;?php echo $url; ?&gt;" width="587" height="330" /&gt;
                          &lt;div&gt;
                              &lt;h4&gt;&lt;?php the_title(); ?&gt;&lt;/h4&gt;
                              &lt;p id="spacer"&gt;&amp;nbsp;&lt;/p&gt;
                              &lt;p&gt;&lt;?php the_excerpt(); ?&gt;&lt;/p&gt;
                              &lt;p&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;Read More...&lt;/a&gt;&lt;/p&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;?php
                      }
                  }
                  wp_reset_query();
  
                  ?&gt; 
              &lt;/div&gt;
  </code></pre>
  
  <p>The URL to see what is happening is here:
  <a href="http://template.seniorshomecaregivers.com/" rel="nofollow">http://template.seniorshomecaregivers.com/</a></p>
  
  <p>I'm using the URL in the slider.</p>
  
  <p>As you can see it only pulls the first URL after that they all return blank.</p>
  
  <p>Thanks in advance for your help.</p>