Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Advanced Custom Fields get sub field image

<?php
$imageID = get_sub_field('your_field');
$image = wp_get_attachment_image_src( $imageID, 'full' );
$alt_text = get_post_meta($imageID, '_wp_attachment_image_alt', true);
?>
<img src="<?php echo $image[0]; ?>" alt="<?php echo $alt_text; ?>" />
Source by mrwp.io #
 
PREVIOUS NEXT
Tagged: #Advanced #Custom #Fields #field #image
ADD COMMENT
Topic
Name
1+3 =