title: Get the Wordpress attachment image url
body: <p>I am trying to display all the images attached to a wordpress post and link the image to the source of the image to open it in a light box. I am using the following code:</p>
  
  <pre><code>if (have_posts())
  {
      while (have_posts())
      {
          the_post();    
          $args = array(
              'orderby' =&gt; 'title',
              'order' =&gt; 'ASC',
              'post_type' =&gt; 'attachment',
              'numberposts' =&gt; -1,
              'post_status' =&gt; null,
              'post_parent' =&gt; $post-&gt;ID,
              'exclude' =&gt; get_post_thumbnail_id()
          );
          $attachments = get_posts( $args );
          if ($attachments)
          {
              foreach ($attachments as $attachment)
              {
                  ?&gt;
                  &lt;div id="image"&gt;
                      &lt;a rel="lightbox" href="&lt;?php /* ??? */ ?&gt;"&gt;
                      &lt;?php echo wp_get_attachment_image ($attachment-&gt;ID, 'full'); ?&gt;
                      &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;?php
              }
          }
      }
  }
  </code></pre>
  
  <p>I have tried many things where the <code>???</code> but i can't seem to retrieve just the source url.</p>
  
  <p>Can anyone provide some insight?</p>