<?php
  $content = get_sub_field('content');

  // IMG 1
  $image_1 = get_sub_field('image_1');
  $content_1 = get_sub_field('txt_1');
  $sub_content_1 = get_sub_field('sub_txt_1');
  // IMG 2
  $image_2 = get_sub_field('image_2');
  $content_2 = get_sub_field('txt_2');
  $sub_content_2 = get_sub_field('sub_txt_2');
  // IMG 3
  $image_3 = get_sub_field('image_3');
  $content_3 = get_sub_field('txt_3');
  $sub_content_3 = get_sub_field('sub_txt_3');
  // IMG 4
  $image_4 = get_sub_field('image_4');
  $content_4 = get_sub_field('txt_4');
  $sub_content_4 = get_sub_field('sub_txt_4');
?>

<div class="layout-valuta-grid-small" id="flex-section-<?php echo get_row_index();?>" >
  <!-- IMAGE 1 -->
  <?php if($image_1):?>
    <div class="small-grid-el el-1">
      <div class="el--inner">
        <img class="" src="<?php echo $image_1['url']; ?>" alt="<?php echo $image_1['alt'] ?>" />
         <?php echo '<h5>'.$content_1.'</h5>'; ?>
         <?php echo '<h6>'.$sub_content_1.'</h6>'; ?>
      </div>
    </div>
  <?php endif;?>
  <!-- IMAGE 2 -->
  <?php if($image_2):?>
    <div class="small-grid-el el-2">
      <div class="el--inner">
        <img class="" src="<?php echo $image_2['url']; ?>" alt="<?php echo $image_2['alt'] ?>" />
         <?php echo '<h5>'.$content_2.'</h5>'; ?>
         <?php echo '<h6>'.$sub_content_2.'</h6>'; ?>
      </div>
    </div>
  <?php endif;?>
  <!-- IMAGE 3 -->
  <?php if($image_3):?>
    <div class="small-grid-el el-3">
      <div class="el--inner">
        <img class="" src="<?php echo $image_3['url']; ?>" alt="<?php echo $image_3['alt'] ?>" />
         <?php echo '<h5>'.$content_3.'</h5>'; ?>
         <?php echo '<h6>'.$sub_content_3.'</h6>'; ?>
      </div>
    </div>
  <?php endif;?>
  <!-- IMAGE 4 -->
  <?php if($image_4):?>
    <div class="small-grid-el el-4">
      <div class="el--inner">
        <img class="" src="<?php echo $image_4['url']; ?>" alt="<?php echo $image_4['alt'] ?>" />
         <?php echo '<h5>'.$content_4.'</h5>'; ?>
         <?php echo '<h6>'.$sub_content_4.'</h6>'; ?>
      </div>
    </div>
  <?php endif;?>
  <div class="block-content">
    <div class="layout-content"><?= $content ?></div>
  </div>
</div>
