From bd95014d3b91d0bbd4fa074bee2ec16bb418ad67 Mon Sep 17 00:00:00 2001 From: AK Delfin Date: Wed, 18 Jun 2025 13:44:08 +0300 Subject: [PATCH] add beta rfo --- category-rfo.php | 60 ++++++-- content-post-main-rfo.php | 24 +++ content-post-rfo.php | 2 +- footer-rfo.php | 24 +-- frontend/src/styles/components/featured.css | 59 -------- frontend/src/styles/rfo/article.css | 153 +++++++++++++++++++- frontend/src/styles/rfo/articles.css | 0 frontend/src/styles/rfo/featured.css | 20 ++- frontend/src/styles/rfo/rfo.css | 50 ++++++- functions.php | 2 + header-rfo.php | 89 +----------- rfo/breadcrumbs-rfo.php | 17 +++ rfo/logoline.php | 8 + {partials => rfo}/menu-rfo.php | 0 rfo/post-list.php | 22 +++ rfo/related-posts.php | 3 +- 16 files changed, 347 insertions(+), 186 deletions(-) create mode 100644 content-post-main-rfo.php delete mode 100644 frontend/src/styles/components/featured.css create mode 100644 frontend/src/styles/rfo/articles.css create mode 100644 rfo/breadcrumbs-rfo.php create mode 100644 rfo/logoline.php rename {partials => rfo}/menu-rfo.php (100%) create mode 100644 rfo/post-list.php 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 @@ -