diff --git a/category-rfo.php b/category-rfo.php index c6dd363..19d34b6 100644 --- a/category-rfo.php +++ b/category-rfo.php @@ -1,23 +1,53 @@ -
- -
- -

name ?>

- -
-
+ +
+ +name !== 'РФО') { + get_template_part( 'rfo/breadcrumbs-rfo' ); +} +?> + +
name; ?>
+
'post', - 'posts_per_page' => 13, - 'paged' => $paged, - 'category__in' => get_queried_object_id() - ); + + + // Проверяем, есть ли у текущей рубрики родительская рубрика + if ($current_category->parent == 0) { + // Это родительская рубрика - получаем все её подрубрики + $child_categories = get_categories(array( + 'child_of' => $current_category->term_id, + 'hide_empty' => false + )); + + // Собираем ID всех подрубрик + ID текущей родительской + $category_ids = array($current_category->term_id); + foreach ($child_categories as $child) { + $category_ids[] = $child->term_id; + } + + $args = array( + 'post_type' => 'post', + 'posts_per_page' => 14, + 'paged' => $paged, + 'category__in' => $category_ids + ); + } else { + // Это подрубрика - выводим только её посты + $args = array( + 'post_type' => 'post', + 'posts_per_page' => 14, + 'paged' => $paged, + 'category__in' => array($current_category->term_id) + ); + } + $query = new WP_Query($args); ?> - $query]); ?> + $query]); ?>
diff --git a/content-post-main-rfo.php b/content-post-main-rfo.php new file mode 100644 index 0000000..fa894ac --- /dev/null +++ b/content-post-main-rfo.php @@ -0,0 +1,24 @@ + +
+
+ + + +
+
+ +
+ + +

+ +
+
+
Подробнее
+ +
+
+
\ No newline at end of file diff --git a/content-post-rfo.php b/content-post-rfo.php index 9e16602..9d11214 100644 --- a/content-post-rfo.php +++ b/content-post-rfo.php @@ -1,7 +1,7 @@
diff --git a/footer-rfo.php b/footer-rfo.php index efc2cde..85b2f66 100644 --- a/footer-rfo.php +++ b/footer-rfo.php @@ -1,27 +1,17 @@ -