= get_queried_object()->name ?>
'post',
'post_status' => 'publish',
'paged' => $paged,
'posts_per_page' => get_option('posts_per_page'),
'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);
?>
$query]); ?>