I used two wp query by rand from one category for two colums left (into two posts) and right (one post), sometimes coincides posts, how i can use one wp query by rand and add class for left colum for adding class flex-direction: colum ?
<div class="info__block__main d-flex">
<div class="small__info__block">
<div class="child__info__block d-flex">
<?php
$project_cat = array(1,7,33,38,43,40,35,45);
$select_post_1 = get_field('select_post_from_services_small');
$args = array(
'paged' => $paged,
'cat' => $project_cat,
'post_type' => 'post',
'posts_per_page' => 2,
'post__in' => $select_post_1,
'orderby' => 'rand'
);
$query = new WP_Query($args);
if($query->have_posts()) :
while($query->have_posts()) :
$query->the_post();
get_template_part('parts/project', 'parts2');
endwhile;
wp_reset_query();
endif;
?>
</div>
</div>
<div class="big__info__block">
<?php
$project_cat = array(1,7,33,38,43,40,35,45);
$select_post = get_field('select_post_from_services_big');
$args = array(
'paged' => $paged,
'cat' => $project_cat,
'post_type' => 'post',
'posts_per_page' => 1,
'post__in' => $select_post,
'orderby' => 'rand'
);
$query = new WP_Query($args);
if($query->have_posts()) :
while($query->have_posts()) :
$query->the_post();
get_template_part('parts/project', 'parts1');
endwhile;
wp_reset_query();
endif;
?>
</div>
</div>
I try add count into loop, but result unsuccess, maybe i cant right clear code.