Home Forums ACF PRO Image size of group field image


Image size of group field image

  • Can anyone help, I am using a group field with an image, and it’s working great as code below, only it uses the large image as my background, i’d like to use the thumbnail size, but struggling to find any advice online on how to incorporate the size in this code.

    // vars
    $webdesign = get_field('web_design');
    if( $webdesign ): ?>
    <div class="web-design" style="background-image:url(<?php echo $webdesign['image']['url']; ?>);">		
    <div class="service-label"><?php echo $webdesign['title']; ?></div>
    </div><?php endif; ?>

    Many thanks in advance.

  • This is covered in the documentation under Customized display (arrray). It would look something like this

    echo $webdesign['image']['sizes']['thumbnail'];
  • Thanks John, I could not see that for looking. worked a treat.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.