add interview styles
This commit is contained in:
@@ -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(); ?>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
global $wp_query;
|
||||
$large_first_image = $args['large_first_image'] ?? true;
|
||||
$has_video = $args['has_video'] ?? false;
|
||||
$post_counter = 0;
|
||||
$query = $args['query'] ?? $wp_query;
|
||||
if ($query->have_posts()) {
|
||||
@@ -10,11 +11,11 @@ if ($query->have_posts()) {
|
||||
$query->the_post();
|
||||
|
||||
if ( $post_counter == 1 ) :
|
||||
get_template_part('content', 'post-main-rfo', ['full_width' => $post_count === 1 ]);
|
||||
get_template_part('content', 'post-main-rfo', ['full_width' => $post_count === 1, 'has_video' => $has_video ]);
|
||||
elseif ( $post_counter == 2) :
|
||||
get_template_part('content', 'post-rfo', ['full_width' => $post_count === 1 && $large_first_image]);
|
||||
get_template_part('content', 'post-rfo', ['full_width' => $post_count === 1 && $large_first_image, 'has_video' => $has_video]);
|
||||
else:?>
|
||||
<?get_template_part('content', 'post-rfo', ['full_width' => false]);?>
|
||||
<?get_template_part('content', 'post-rfo', ['full_width' => false, 'has_video' => $has_video]);?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?wp_reset_postdata();
|
||||
|
||||
Reference in New Issue
Block a user