Answers for "acf image id"

PHP
1

image acf

<?php 
$image = get_field('image');
if( !empty( $image ) ): ?>
    <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" />
<?php endif; ?>
Posted by: Guest on February-11-2021
1

acf image showing id instead of url

<?php 
$image = get_field('image');
$size = 'full'; // (thumbnail, medium, large, full or custom size)
if( $image ) {
    echo wp_get_attachment_image( $image, $size );
}
Posted by: Guest on June-19-2020

Browse Popular Code Answers by Language