Skip Navigation

[Resolved] displaying ACF image with toolset types and views

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.

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Marisa 5 years, 10 months ago.

Assigned support staff: Ross Fisher.

Author
Posts
#346296
howitshoulddisplay.JPG
display.JPG

This is exactly described in this ticket:
https://toolset.com/forums/topic/how-do-i-display-a-custom-image-field-created-with-acf-in-views/

However, the user didn't receive or didn't wait to receive the correct answer because he had to use a php plugin instead of a shortcode.

I am also trying to display an ACF image with Views. I also have the output set to URL but it just outputs the number "324."

<div class="col-fourth">
  <div class="buyer-image">[wpv-post-field name="customer_image"]</div>
</div>
<div class="col-three-fourth">
  <div class="">[wpv-post-field name="story"]</div>
</div>
#346317

Thank you for contacting Toolset Support, I'd be delighted to assist!

Toolset cannot manipulate a variable that is set by a 3rd party plugin, for example ACF is storing the image by the image ID instead of the URL. If this was in Toolset, we have a built in function which is triggered when output is set to URL to lookup the Image ID and return the URL.

What you'll need to do is write a function in your theme's function.php file (or write a simple plugin) using the wp get attachment method: https://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src

As we cannot modify ACF to add the missing function to convert the Image ID to a URL, I fear custom work will be required on your end to resolve this.

As the other customer mentioned, the plugin link provided should be an easy way for you to create this function with minimal know-how and hassle.

I look forward to your reply!

#346323

ah, that plugin doesn't exist anymore. Trying alternatives to allow php to be executed in views. Ideas?

#346326

PHP Code for Posts and Pages
is awesome
https://wordpress.org/plugins/php-code-for-posts/