[Resolved] The ID for an image is displaying, not the image

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

This topic contains 2 replies, has 2 voices, and was last updated by  HashimW3633 1 week ago. The support staff assigned to this topic is Christian Cox.

Viewing 3 posts - 1 through 3 (of 3 total)
Author
Posts
#559202

I am trying to: Create a view that displays an image

<wpv-loop>
<h3>[wpv-post-field name="instructor_name"]</h3>
[wpv-post-field name="instructor_photo"]</br>
[wpv-post-field name="instructor_bio"]
</wpv-loop>

I expected to see: The "instructor name", the "instructor photo", and the "instructor bio"

Instead, I got: An image ID instead of the image.

Note: I used Advanced Custom Fields to make the image field.

#559353

Christian Cox
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/New_York (GMT-04:00)

Hi, there's not a straightforward way to get an image from ACF fields using Types, because there's not a simple way to get an image field's URL from ACF. ACF stores the attachment ID instead of a URL to the image, so extra custom code to turn the attachment ID into an attachment URL. Here are some references for you:
1) wp_get_attachment_image
Get an HTML img element representing an image attachment
https://developer.wordpress.org/reference/functions/wp_get_attachment_image/

2) add shortcode
Adds a hook for a shortcode tag.
https://codex.wordpress.org/Function_Reference/add_shortcode

Otherwise, it's probably best to consult their support forums to see if there's a simple shortcode you can use to access the field. I'm not the best source of information about their fields, but quick search led me to this forum post:
https://support.advancedcustomfields.com/forums/topic/acf-image-shortcodes/

#560378

I'm now using the ACF image shortcode and it works fine. Thank you for going above and beyond, Christian!

Viewing 3 posts - 1 through 3 (of 3 total)

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

Known issues and their solutions

We document known issues and their solutions in Toolset erratas. Save time by checking there first and seeing if what you are facing is a known issue. This list is kept short. We do our best to resolve all known issues with every release of Toolset plugins.

Support Policy

Toolset staff will help you use the Toolset plugins correctly, provide any information you need, help troubleshoot problems and advice on best-practices.

Please make sure to issue only one topic per each support ticket.

For more information, read our full Customer Support Policy.

Need custom programming work for your site? Check out our certified partners.