<?php
$post = (!empty($_POST)) ? true : false;
if($post) {
if ( have_rows( 'opczii', 178 ) ) :
while ( have_rows( 'opczii', 178 ) ) : the_row();
$sub_value = get_sub_field('nazvanie', 178);
endwhile;
else :
endif;
$error = '';
if(!$error) {
$address = "mail@mail.ru";
$mes = "" .$sub_value."\n\n";
$send = mail ($address,$sub,$mes,"Content-type:text/plain; charset = UTF-8\r\nReply-To:$email\r\nFrom:$name <contact>");
if($send) {echo 'OK';}
}
else {echo '<div class="err">'.$error.'</div>';}
}
?>
<div class="grid-container">
<div class="news "></div>
<div class="news "></div>
<div class="news "></div>
<div class="news "></div>
</div>
<style>
.grid-container {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr;
}
.news:nth-child(1) { grid-area: 1 / 2 / 2 / 3; }
.news:nth-child(2) { grid-area: 2 / 2 / 3 / 3; }
.news:nth-child(3) { grid-area: 1 / 3 / 3 / 5; }
.news:nth-child(4) { grid-area: 1 / 1 / 3 / 2; }
</style>