WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. redwall
    Member
    Posted 1 year ago #

    Hi,

    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?

    http://wordpress.org/extend/plugins/advanced-custom-fields/

  2. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    Hi @redwall

    Please use the ACF API functions.

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

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

  3. mariteslq
    Member
    Posted 1 year ago #

    Hello,

    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.

    Thanks.

  4. xzuxzu
    Member
    Posted 1 year 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

About this Topic