update theme

This commit is contained in:
2024-03-12 09:16:19 +03:00
parent 10722da013
commit bef7aac0d5
74 changed files with 2018 additions and 2417 deletions

View File

@@ -8,33 +8,34 @@ $args = array(
'category_name' => get_queried_object()->slug
);
$counter = 0;
query_posts( $args );
query_posts($args);
?>
<?php get_header() ?>
<div class="content-middle articles-wrapper">
<div class="content-middle articles-wrapper">
<? get_template_part('partials/rubrics-mobile'); ?>
<div class="section-title border-top">
<h1 class="section-title__title"><?=get_queried_object()->name?></h1>
</div>
<? get_template_part('partials/rubrics-mobile'); ?>
<div class="section-title border-top">
<h1 class="section-title__title"><?= get_queried_object()->name ?></h1>
</div>
<div class="articles-preview">
<? if ( have_posts() ) : ?>
<?while ( have_posts() ) : the_post();?>
<? $counter++; $formatted_date = format_event_date(); ?>
<div class="articles-preview">
<? if (have_posts()) : ?>
<? while (have_posts()) : the_post(); ?>
<? $counter++;
$formatted_date = format_event_date(); ?>
<a href="<? the_permalink(); ?>">
<div class="article-item">
<div class="interview-item__image-container">
<?= show_post_image(); ?>
<button class="item-video__button subtitle-20">
<img src="<?= get_asset('icons/play.svg') ?>" alt=""/> Интервью
<img src="<?= get_asset('icons/play.svg') ?>" alt="" /> Интервью
</button>
</div>
<div class="article-item__text">
<div class="article-time">
<img src="<?= get_asset('icons/time.svg') ?>" alt=""/>
<img src="<?= get_asset('icons/time.svg') ?>" alt="" />
<time><?= $formatted_date; ?></time>
</div>
<a href="<? the_permalink(); ?>" class="subtitle-16 article-item__link">
@@ -43,25 +44,19 @@ query_posts( $args );
</div>
</div>
</a>
<? endwhile; ?>
<? if ($counter == 4) {
$banners = wp_is_mobile() ? get_field('banner_between_posts_mobile', 'option') : get_field('banner_between_posts', 'option');
if($banners){
$rand_keys = array_rand($banners, 1);
if (isset($banners[$rand_keys]) && !empty($banners[$rand_keys]['image_banner'])) {
echo '<a href="' . $banners[$rand_keys]['link'] . '">
<div class="banner-middle">
<img src="' . $banners[$rand_keys]["image_banner"]["url"] . '" alt="">
</div>
</a>';
}
}
}
?>
<? endif;?>
<a href="<?= home_url(); ?>" class="articles-preview__show-next mobile">На главную</a>
</div>
<? custom_pagination(); ?>
<? endwhile; ?>
<? if ($counter == 4) : ?>
<div class="banner-middle desktop">
<?php if (function_exists('banners_conf_display')) banners_conf_display('content_banner_desktop'); ?>
</div>
<div class="banner-middle mobile">
<?php if (function_exists('banners_conf_display')) banners_conf_display('content_banner_mobile'); ?>
</div>
<? endif; ?>
<? endif; ?>
<a href="<?= home_url(); ?>" class="articles-preview__show-next mobile">На главную</a>
</div>
<? custom_pagination(); ?>
</div>
<?php
get_footer() ?>