Support

Account

Forum Replies Created

  • 
    <?php
        $img=get_sub_field('testimonial_picture_or_logo');
        $alt= $img['alt'];
        $size = 'medium'; // (thumbnail, medium, large, full or custom size)
        $thumb = $img['sizes'][ $size ];
        if ($img): ?>
          <div class="imgContainer2">
            <div>
              <img src="<?php echo $thumb; ?>" alt="<?php echo $alt ?>">
            </div>
          </div>
        <?php endif;
    ?>
    

    This one is proper way to get img with sizes defined in database……..
    this code is part of ACF Pro, where i am using this img from sub filed, that can be changed to get_field

Viewing 1 post (of 1 total)