Inserting ACF Images

This topic contains 5 reply and 2 voices, and was last updated by Jeff Fisher 9 years, 12 months ago
Viewing 5 Posts - 1 through 5 (of 5 total)
Author Posts
April 4, 2014 at 1:24 am 17981
Jeff Fisher I am using the advanced custom fields (ACF) plugin and need to drop an ACF created image onto my page. When I do the insert, all that gets shown is the image ID. The code shows and I get a broken link pic on my page. I have the ACF image element set to record ID, so I think this should work. Any ideas?
April 4, 2014 at 6:57 am 17995
Mahi Mahi

So, you are using WPUF from frontend to insert/upload image or from backend by using ACF?

If by WPUF, then check Documentation here: http://docs.wedevs.com/showing-meta-fields-in-frontend/

April 4, 2014 at 7:42 am 18004
Jeff Fisher Jeff Fisher

Still not working…

ACF meta field is “coupon_img”

The following code:

ID, ‘coupon_img’ );
if ( $images ) {
foreach ( $images as $attachment_id ) {
$thumb = wp_get_attachment_image( $attachment_id, ‘thumbnail’ );
$full_size = wp_get_attachment_url( $attachment_id );
printf( ‘%s‘, $full_size, $thumb );
}
}
?>

Is not showing the image. Any other ideas?

Should the ACF image be added as an Image Object, Image URL, or Image ID

Thanks,

Jeff

On Thu, Apr 3, 2014 at 8:57 PM, weDevs Team wrote: > Mahi wrote:

So, you are using WPUF from frontend to insert/upload image or from
backend by
using ACF?

If by WPUF, then check Documentation here:
http://docs.wedevs.com/showing-meta-fields-in-frontend/ [0]

April 4, 2014 at 7:49 am 18007
Mahi Mahi

If i am not wrong then, ACF add

acf_

at front on each custom field’s meta_key by default? isn’t it?

April 4, 2014 at 8:09 am 18008
Jeff Fisher Jeff Fisher

Like this? $images = get_post_meta( $post->ID, ‘acf_coupon_img’ );

On Thu, Apr 3, 2014 at 9:49 PM, weDevs Team wrote: > Mahi wrote:

If i am not wrong then, ACF add
> acf_
at front on each custom field’s meta_key by default? isn’t it?

April 4, 2014 at 9:00 pm 18027
Jeff Fisher Jeff Fisher

When an image is saved to the database, how is it saved?

Is it an object, ID or URL? Depending on how it is saved, I have different ways to show the image.

Thanks

Viewing 5 Posts - 1 through 5 (of 5 total)