WordPress.org

Support

Support » Plugins and Hacks » Advanced Custom Fields » [Plugin: Advanced Custom Fields] Retuning the ID of the image instead of the url

[Plugin: Advanced Custom Fields] Retuning the ID of the image instead of the url

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi mrbrand. I got stuck on this just now and found the answer:

    Let’s say your field is named additional_image, then you’d use this code in your template:

    <img src=”<?php the_field(‘additional_image’); ?>” alt=”blah blah blah” />

    That would generate the url of the image and thus show up.

    More details here:

    http://www.advancedcustomfields.com/docs/field-types/image/

    Hope that helps!

    Just to add, even though you have selected image url as return value the custom field with still produce the attachment id number as the value (which is what puzzled me at first), but the code behind “the_field” function will allow it to get the url information.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Advanced Custom Fields] Retuning the ID of the image instead of the url’ is closed to new replies.
Skip to toolbar