[Plugin: Advanced Custom Fields] Display custom image-size
-
Hi,
I have some issues with Advanced Custom Fields plugin. The custom field image uses the dimensions of my predefined thumbnail-size, but I want it to use the medium-size. I tried some of the advises from the support-board and put the code into my template file (see below), but it doesn’t have any effect no matter what I’m trying. Help is much appreciated.
<?php $attachment_id = get_field('field_name'); $size = "medium"; // (thumbnail, medium, large, full or custom size) $image = wp_get_attachment_image_src( $attachment_id, $size ); // url = $image[0]; // width = $image[1]; // height = $image[2]; ?> <img src="<?php echo $image[0]; ?>" />
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘[Plugin: Advanced Custom Fields] Display custom image-size’ is closed to new replies.