add interview styles

This commit is contained in:
2025-06-22 14:09:09 +03:00
parent 3cb726055c
commit 86687a1832
8 changed files with 202 additions and 63 deletions

View File

@@ -11,9 +11,26 @@
// Извлекаем параметры
$category = isset($args['category']) ? $args['category'] : 'rfo';
$title = isset($args['title']) ? $args['title'] : 'РФО';
$title = isset($args['title']) ? $args['title'] : '';
$wrapper = isset($args['wrapper']) ? $args['wrapper'] : 'article-item-wrapper__rfo';
$style = isset($args['style']) ? $args['style'] : 0;
$style = isset($args['style']) ? $args['style'] : '';
$has_video = isset($args['has_video']) ? $args['has_video'] : false;
if ( $style == 'short' ){
$wrapper = 'article-short-wrapper__rfo';
$color_style = 'article-short-rfo';
$short = true;
} else {
$short = false;
$wrapper = 'article-item-wrapper__rfo';
if ($style == '') {
$color_style = 'article-item-rfo';
} else {
$color_style = 'article-item-rfo '.$style;
}
}
$posts_count = isset($args['posts_count']) ? $args['posts_count'] : 1;
?>
<div class="custom-category-block" data-category="<?php echo esc_attr($category); ?>">
@@ -28,20 +45,16 @@ $posts_count = isset($args['posts_count']) ? $args['posts_count'] : 1;
$query = new WP_Query($query_args);
if ($query->have_posts()) : ?>
<div class="<?=$wrapper?>">
<div class="land-cart-title">
<div class="land-cart-title__text"><?php echo esc_html($title); ?></div>
<div class="land-cart-title__arrow"></div>
</div>
<div class="article-item-rfo">
<?php while ($query->have_posts()) : $query->the_post(); ?>
<?get_template_part( 'content', 'post-rfo', [ 'class'=>'article-item-rfo '.$style ] );?>
<?php endwhile; ?>
</div>
</div>
<?php while ($query->have_posts()) : $query->the_post(); ?>
<?get_template_part( 'content', 'post-rfo',
[
'class'=>$color_style,
'title' => $title,
'has_video' => $has_video
]);?>
<?php endwhile; ?>
<?php endif;
wp_reset_postdata(); ?>