Get url from image field For each user, I created a new field called field_cover, this field is an image.

I want to get the field_cover path, to use it into a background-image property.

I try this but it does not work.

&lt;?php print render (file_create_url($user_profile['field_cover'])); ?&gt;


Thanks for your help !
The function file_create_url() in D7 needs a uri (see this useful article). You can typically access the uri of a file this way:

$user_object-&gt;field_name[LANGUAGE_NONE][0]['uri'].

In your case, since $user_profile seems to be an array of fields, try:

file_create_url($user_profile['field_cover'][LANGUAGE_NONE][0]['uri']).

This should return the full URL of the image.

Further information in your question may help me fine tune this answer.