Return only one array
-
When we echo the images, it echo all the images inside the custom field, but when we return, it just return one image. How to use return in here? We wanted to use return not echo because of one plugin. Thanks!
$images = get_field('images'); $size = 'full'; // (thumbnail, medium, large, full or custom size) if( $images ){ foreach( $images as $image_id ){ echo wp_get_attachment_image( $image_id, $size ); } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Return only one array’ is closed to new replies.