2025-06-18 13:44:08 +03:00
|
|
|
<?php
|
|
|
|
|
global $wp_query;
|
|
|
|
|
$large_first_image = $args['large_first_image'] ?? true;
|
2025-06-22 14:09:09 +03:00
|
|
|
$has_video = $args['has_video'] ?? false;
|
2025-06-18 13:44:08 +03:00
|
|
|
$post_counter = 0;
|
|
|
|
|
$query = $args['query'] ?? $wp_query;
|
|
|
|
|
if ($query->have_posts()) {
|
|
|
|
|
while ($query->have_posts()) {
|
|
|
|
|
$post_counter++;
|
|
|
|
|
$end = $query->post_count;
|
|
|
|
|
$query->the_post();
|
|
|
|
|
|
|
|
|
|
if ( $post_counter == 1 ) :
|
2025-09-03 00:13:32 +03:00
|
|
|
//get_template_part('content', 'post-main-rfo', ['full_width' => $post_count === 1, 'has_video' => $has_video ]);
|
|
|
|
|
get_template_part('content', 'post-rfo', ['full_width' => $post_count === 1, 'has_video' => $has_video ]);
|
2025-06-18 13:44:08 +03:00
|
|
|
elseif ( $post_counter == 2) :
|
2025-06-22 14:09:09 +03:00
|
|
|
get_template_part('content', 'post-rfo', ['full_width' => $post_count === 1 && $large_first_image, 'has_video' => $has_video]);
|
2025-06-18 13:44:08 +03:00
|
|
|
else:?>
|
2025-06-22 14:09:09 +03:00
|
|
|
<?get_template_part('content', 'post-rfo', ['full_width' => false, 'has_video' => $has_video]);?>
|
2025-06-18 13:44:08 +03:00
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
<?wp_reset_postdata();
|
|
|
|
|
}
|
|
|
|
|
}?>
|