2025-05-29 00:59:59 +03:00
|
|
|
<?php get_header( 'forest' ); ?>
|
|
|
|
|
|
|
|
|
|
<div class="content-middle articles-wrapper">
|
2025-05-29 14:28:34 +03:00
|
|
|
|
|
|
|
|
|
2025-05-29 00:59:59 +03:00
|
|
|
<div class="section-title desktop">
|
2025-05-29 14:28:34 +03:00
|
|
|
<?php if (is_category()) :
|
|
|
|
|
$current_cat = get_queried_object();?>
|
|
|
|
|
<?php if ( $current_cat->name == 'Защита леса — защита будущего' ):?>
|
|
|
|
|
<h1 class="section-title__title">Международная научно-практическая конференция<br>«Защита леса — защита будущего»</h1>
|
|
|
|
|
<?php else:?>
|
|
|
|
|
<h1 class="section-title__title"><?= get_queried_object()->name ?></h1>
|
|
|
|
|
<?php endif;
|
|
|
|
|
endif; ?>
|
2025-05-29 00:59:59 +03:00
|
|
|
</div>
|
|
|
|
|
<div class="articles-preview">
|
|
|
|
|
<?php
|
|
|
|
|
$current_category = get_queried_object();
|
|
|
|
|
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1; // Защита через absint()
|
|
|
|
|
|
|
|
|
|
$args = [
|
|
|
|
|
'post_type' => 'post',
|
|
|
|
|
'post_status' => 'publish',
|
|
|
|
|
'paged' => $paged,
|
2025-06-02 10:41:32 +03:00
|
|
|
'posts_per_page' => 13,
|
2025-05-29 00:59:59 +03:00
|
|
|
'ignore_sticky_posts' => true,
|
|
|
|
|
'no_found_rows' => false // Обязательно для пагинации!
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// Обработка родительских/дочерних рубрик
|
|
|
|
|
if (!$current_category->parent) {
|
|
|
|
|
$child_categories = get_term_children($current_category->term_id, 'category');
|
|
|
|
|
$args['category__in'] = array_merge([$current_category->term_id], (array)$child_categories);
|
|
|
|
|
} else {
|
|
|
|
|
$args['cat'] = $current_category->term_id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$query = new WP_Query($args);
|
|
|
|
|
?>
|
|
|
|
|
<?php get_template_part('partials/post-list', null, ['query' => $query]); ?>
|
|
|
|
|
</div>
|
|
|
|
|
<?php custom_pagination(); ?>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php get_footer( 'forest' ); ?>
|