I have used ACF plugin to add custom post meta box image field. My custom image field name is homepage_full_width.
How can i display post thumbnail image using this custom field image.
thanks.
You can use image ID as the return type of the ACF custom image field then you can use the wp_get_attachment_image() function to generate the image HTML.
$image = get_field('homepage_full_width');
$size = 'thumbnail'; // (thumbnail, medium, large, full or custom size)
if( $image ) {
echo wp_get_attachment_image( $image, $size );
}
UPDATE
Use image Object as the return type then try
<?php
$imageBg = get_field('homepage_full_width');
$bg = $imageBg ? $imageBg['url'] : '';
?>
<div class="zl-homefullwidth-img parallax_bg skrollable skrollable-between" style="transform: translate3d(0px, 0.382158%, 0px);background-image: url(<?php echo $bg; ?>)"></div>