From b0536e98b8e227acf657f56667aaae34d2b18b5c Mon Sep 17 00:00:00 2001 From: AK Delfin Date: Mon, 16 Jun 2025 20:16:54 +0300 Subject: [PATCH] add single page rfo --- content-post-rfo.php | 25 +++++++++++ frontend/src/main.js | 3 ++ frontend/src/styles/rfo/article.css | 65 +++++++++++++++++++++++++++++ frontend/src/styles/rfo/rfo.css | 2 +- rfo/related-posts.php | 33 +++++++++++++++ 5 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 content-post-rfo.php create mode 100644 frontend/src/styles/rfo/article.css create mode 100644 rfo/related-posts.php diff --git a/content-post-rfo.php b/content-post-rfo.php new file mode 100644 index 0000000..9e16602 --- /dev/null +++ b/content-post-rfo.php @@ -0,0 +1,25 @@ + +
+
+ + + +
+
+ +
+ + +

+ +
+
+
Подробнее
+ +
+
+
\ No newline at end of file diff --git a/frontend/src/main.js b/frontend/src/main.js index 4176785..34493f6 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -28,6 +28,9 @@ import './styles/rfo/rfo.css'; import './styles/rfo/search-rfo.css'; import './styles/rfo/featured.css'; import './styles/rfo/social.css'; +import './styles/rfo/article.css'; +import './styles/rfo/breadcrumbs.css'; + import './scripts/calendar.js'; import './scripts/menu-vertical.js'; diff --git a/frontend/src/styles/rfo/article.css b/frontend/src/styles/rfo/article.css new file mode 100644 index 0000000..c23d240 --- /dev/null +++ b/frontend/src/styles/rfo/article.css @@ -0,0 +1,65 @@ +.articles-preview-rfo{ + display: flex; /* Активируем Flexbox */ + justify-content: space-between; /* Равномерное распределение пространства между колонками */ + /* или можно использовать justify-content: space-around; */ + gap: 10px; /* Расстояние между колонками */ +} + +.article-item-wrapper__rfo{ + flex: 1; + background-color: white; + width: 100%; + border: 6px solid white; + border-radius: 14px; +} + +.article-item-rfo{ + position: relative; + height: 409px; + background: #f1f3eb; /* пример фона */ + + /* МАСКА через встроенный data URI */ + -webkit-mask-image: url('data:image/svg+xml;utf8,'); + -webkit-mask-repeat: no-repeat; + -webkit-mask-size: cover; + + mask-image: url('data:image/svg+xml;utf8,'); + mask-repeat: no-repeat; + mask-size: cover; +} + +.article-section-title__rfo{ + font-family: var(--second-family); + font-weight: 700; + font-size: 22px; + line-height: 150%; + text-transform: uppercase; + text-align: center; +} + +.article-rfo-details{ + position: absolute; + bottom: 12px; + right: 20px; + display: flex; + gap: 8px; + color: #333; + font-size: 1.6rem; + font-weight: 500; +} + +.article-show-next__rfo{ + border-radius: 10px; + margin: 22px 0; + padding: 15px 25px; + font-weight: 500; + font-size: 1.8rem; + text-align: center; + width: 100%; + background-color: white; +} + + + + + \ No newline at end of file diff --git a/frontend/src/styles/rfo/rfo.css b/frontend/src/styles/rfo/rfo.css index a428073..0cdff97 100644 --- a/frontend/src/styles/rfo/rfo.css +++ b/frontend/src/styles/rfo/rfo.css @@ -48,7 +48,7 @@ } .content-rfo{ - margin-top: -152px; + margin-top: -222px; width: 1200px; max-width: 1200px; } diff --git a/rfo/related-posts.php b/rfo/related-posts.php new file mode 100644 index 0000000..5670202 --- /dev/null +++ b/rfo/related-posts.php @@ -0,0 +1,33 @@ +term_id; + }, $categories); + + $args = array( + 'category__in' => $category_ids, + 'post__not_in' => array($current_post_id), + 'posts_per_page' => 3, + ); + + $related_posts_query = new WP_Query($args); + + if ($related_posts_query->have_posts()) { + + echo '
Читайте также:
'; + echo '
'; + + while ($related_posts_query->have_posts()) { + $related_posts_query->the_post(); + get_template_part('content', 'post-rfo'); + } + + echo '
'; + wp_reset_postdata(); + } +} +?> \ No newline at end of file