ACF Images

images as Object


<?php $image = get_field('fotografia_top'); ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />

 

images as ID


<?php $image = get_field('section_4_image'); $size = 'footer-image'; if( $image ) { echo wp_get_attachment_image( $image, $size ); } ?>

jako wykaz osób i ich opsiów:


<?php if( have_rows('persons') ): ?>
 <div class="persons">
   <?php while ( have_rows('persons') ) : the_row();?>
     <?php
       $image = get_sub_field('person_photo');
       $size = 'pic_person';
       $thumb = $image['sizes'][ $size ];
     ?>
      <div class="person">
        <div class="person-pic">
          <?php if( !empty($image) ): ?>
            <img src="<?php echo $thumb; ?>" alt="<?php echo $image['alt']; ?>" />
          <?php endif; ?>
        </div>
        <div class="person-des">
          <?php the_sub_field('person_name'); ?>
          <?php the_sub_field('person_description'); ?>
        </div>
      </div>
   <?php endwhile; ?>
 </div>
<?php endif; ?>

jako tło pod diva:


<?php $bigimg1ID = get_field('first_box_background');
$bigimg1 = wp_get_attachment_image_src($bigimg1ID, 'thumbnail'); ?>
<div class="home-box-wrapper" style="background-image:url(<?php echo $bigimg1[0];?>);">

</div>

</pre>
<pre><?php $image = get_field('additional_image'); ?>
<img src="<?php echo $image['sizes']['link-box-img']; ?>" alt="<?php echo $image['alt']; ?>" /></pre>
<pre>