Print url to image from profile2 field with mutiple images Hello guys i've been trying to figure this out the past 20 hours but i can't.
I want to print som image url's to a link.
I have this code

&lt;div id="background-slideshow"&gt;
&lt;?php
  $user_fields = user_load(24);
  $profile2 = profile2_load_by_user($user_fields-&gt;uid);
  $image = field_get_items('profile2', $profile2['side'], 'field_baggrundsbillede');    
?&gt;
&lt;?php foreach($image as $key=&gt;$value): ?&gt;
 $output = field_view_value('profile2', $profile2['side'], 'field_baggrundsbillede', $image[$key], array(
  'type' =&gt; 'image',
  'settings' =&gt; array(
    'image_style' =&gt; 'thumbnail'
    'image_link' =&gt; 'content',
  ),
));
  &lt;div class="test"&gt;
   &lt;?php print render($output) ?&gt;
  &lt;/div&gt;
&lt;?php endforeach; ?&gt;
&lt;/div&gt;


But the problem is that it prints the image file, when i want an url.
How can i make that happen?

Thanks

EDIT

&lt;div id="background-slideshow"&gt;
  &lt;?php
    $uid = 24;
    $user_fields = user_load($uid);
    //$profile2 = profile2_load_by_user($user_fields-&gt;uid);
    $images = field_get_items('user', $user_fields, 'field_baggrundsbillede');    
  ?&gt;
  &lt;?php foreach($images as $key =&gt; $image): ?&gt;
    &lt;?php $url = file_create_url($image['uri']); ?&gt;
    &lt;div class="background-image" style="background-image: url(&lt;?php echo $url ?&gt;);"&gt;
    &lt;/div&gt;
  &lt;?php endforeach; ?&gt;
&lt;/div&gt;
To get just the path of an image, use file_create_url
To get the path of an image using an image style, use image_style_url


e.g, in the context of your code:

&lt;div id="background-slideshow"&gt;
&lt;?php
  $uid = 24;
  $user_fields = user_load($uid);
  $profile2 = profile2_load_by_user($user_fields-&gt;uid);
  $images = field_get_items('profile2', $profile2['side'], 'field_baggrundsbillede');    
?&gt;
&lt;?php foreach($images as $key =&gt; $image): ?&gt;
  $url = file_create_url($image['uri']);
  // $url = image_style_url('medium', $image['uri']); // example image style url
  &lt;div class="test"&gt;
   &lt;?php print $url; ?&gt;
  &lt;/div&gt;
&lt;?php endforeach; ?&gt;
&lt;/div&gt;