The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Advanced Custom Fields
[resolved] Image URL is NOT returned (4 posts)

  1. redwall
    Posted 3 years ago #


    I am using a custom field to upload an image in a post. I am then echo'ing this image in the php template using the file URL as the src

    For example

    <img width="150" height="150" alt="" src="<?php echo get_post_meta($post->ID, 'employee_profile_photo_1', true) ?>" title="profile-photo">

    However, it does not work! In the post when adding the image it add's fine and a small thumb is generated in the post admin to show it was added. I guess I am missing a text field to read this URL..

    I have also turned on the field option in ACF when adding a an image file to return the image URL.

    Any help on how to get the URL of the uploaded file?


  2. elliotcondon
    Plugin Author

    Posted 3 years ago #

    Hi @redwall

    Please use the ACF API functions.

    These are documented here (http://www.advancedcustomfields.com/docs/) and consist of:

    You need to use these functions to allow for formatting of values

  3. mariteslq
    Posted 3 years ago #


    Before using Advanced Custom Fields plugin, I added several image URLs as custom field for my pages with the meta_key "brandlogo".

    I've installed the plugin and made a field with image type and a returned value of Image URL. The field group can't select the image defined in the meta_key "brandlogo" and doesn't show in the preview. During an upload of a new image, the id is being returned.

    How can I resolve this? I have already added several meta_values with the image URLs before the plugin.

    Hope you could help.


  4. xzuxzu
    Posted 3 years ago #

    I'm using this plugin, and it is almost perfect. Actually, whatever you decide to choose as returned value, URL is not working. I've spent hours to isolate the glitch, and I've decided to use manual custom field for images URL. I use ACF to access media manager, and I copy/paste URL from there.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Custom Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic