Getting an image from a custom field
-
Hi,
I’m trying to dynamically load images from a certain post type. I’ve used the Advanced Custom Fields plugin to attach an image field to my post. I’m currently using this code:
$.getJSON(‘/?json=get_recent_posts&post_type=slides-verhuur&custom_fields=image’, {}, function(data){
console.log(data);
});However when I run the code, the result JSON I get contains a “custom field” attribute, which have an “image” attribute, but this only contains the value of “80”, which is the ID of the image. Is there a way to get the image url instead?
Thanks in advance.
– Leon
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Getting an image from a custom field’ is closed to new replies.