diff --git a/archive.php b/archive.php index 4c00a03..6a5517a 100644 --- a/archive.php +++ b/archive.php @@ -1,4 +1,12 @@ - +
diff --git a/cookie-consent.php b/cookie-consent.php new file mode 100644 index 0000000..76af6b1 --- /dev/null +++ b/cookie-consent.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/frontend/src/main.js b/frontend/src/main.js index 785daa4..ca329ac 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -18,6 +18,7 @@ import './styles/components/partner-item.css'; import './styles/components/single-partner-item.css'; import './styles/components/suggestion-item.css'; import './styles/components/agro-informer.css'; +import './styles/components/cookie-consent.css'; import './scripts/calendar.js'; import './scripts/menu-vertical.js'; @@ -27,6 +28,7 @@ import './scripts/search-form.js'; import './scripts/select.js'; import './scripts/subscription-form.js'; import './scripts/agroserver.js'; +import './scripts/cookie-consent.js'; import './styles/components/about.css'; import './styles/components/banner.css'; import './styles/components/breadcrumbs.css'; diff --git a/frontend/src/scripts/cookie-consent.js b/frontend/src/scripts/cookie-consent.js new file mode 100644 index 0000000..f5e6043 --- /dev/null +++ b/frontend/src/scripts/cookie-consent.js @@ -0,0 +1,13 @@ +document.addEventListener('DOMContentLoaded', function() { + // Проверяем, дал ли пользователь согласие ранее + if (!localStorage.getItem('cookie_consent_accepted')) { + const banner = document.getElementById('cookie-consent-banner'); + banner.style.display = 'block'; + + document.getElementById('cookie-consent-accept').addEventListener('click', function() { + // Сохраняем согласие в localStorage + localStorage.setItem('cookie_consent_accepted', 'true'); + banner.style.display = 'none'; + }); + } +}); \ No newline at end of file diff --git a/frontend/src/styles/components/cookie-consent.css b/frontend/src/styles/components/cookie-consent.css new file mode 100644 index 0000000..81f3d62 --- /dev/null +++ b/frontend/src/styles/components/cookie-consent.css @@ -0,0 +1,36 @@ +.cookie-consent { + position: fixed; + bottom: 0; + left: 0; + right: 0; + background: #333; + color: #fff; + padding: 15px; + z-index: 9999; + box-shadow: 0 -2px 10px rgba(0,0,0,0.2); + text-align: center; +} + +.cookie-consent-content { + max-width: 1200px; + margin: 0 auto; + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; + gap: 15px; +} + +.cookie-consent-button { + background: #4CAF50; + color: white; + border: none; + padding: 8px 20px; + cursor: pointer; + border-radius: 4px; + font-weight: bold; +} + +.cookie-consent-button:hover { + background: #45a049; +} \ No newline at end of file diff --git a/frontend/src/styles/components/fonts.css b/frontend/src/styles/components/fonts.css index a610c29..83f3ac1 100644 --- a/frontend/src/styles/components/fonts.css +++ b/frontend/src/styles/components/fonts.css @@ -49,6 +49,5 @@ h3, .text-11 { font-weight: 400; - font-size: 1.1rem; line-height: 1.6rem; } diff --git a/functions.php b/functions.php index 8309186..4e65fcf 100644 --- a/functions.php +++ b/functions.php @@ -1278,6 +1278,15 @@ function replace_first_figure_in_content($content) { return $content; } + +function add_cookie_consent() { + if (!isset($_COOKIE['cookie_consent_accepted'])) { + get_template_part('cookie-consent'); + } +} +add_action('wp_footer', 'add_cookie_consent'); + + /** * убираем рубрики - Смена (7) */ diff --git a/sidebar-right.php b/sidebar-right.php index 1a6b9b5..dd60076 100644 --- a/sidebar-right.php +++ b/sidebar-right.php @@ -18,6 +18,9 @@ Подпишитесь на нашу рассылку и будьте в курсе всех новостей

+
+


Нажимая на кнопку «Подписаться», Вы соглашаетесь на обработку персональных данных в соответствии с
«Политикой конфиденциальности»

+
diff --git a/tag.php b/tag.php new file mode 100644 index 0000000..0929435 --- /dev/null +++ b/tag.php @@ -0,0 +1,34 @@ + +
+ +
+ +

+ +
+
+ 'post', + 'posts_per_page' => 13, + 'paged' => $paged, + 'tag_id' => get_queried_object_id() // Используем tag_id вместо category__in + ); + $query = new WP_Query($args); + + // Передаем query через глобальную переменную $wp_query, чтобы избежать ошибки + global $wp_query; + $original_query = $wp_query; + $wp_query = $query; + + get_template_part('partials/post-list'); + + // Восстанавливаем оригинальный запрос + $wp_query = $original_query; + wp_reset_postdata(); + ?> +
+ +
+ \ No newline at end of file diff --git a/templates/contacts.php b/templates/contacts.php index ed2b5db..87da376 100644 --- a/templates/contacts.php +++ b/templates/contacts.php @@ -41,7 +41,8 @@ Template Name: Шаблон страницы контакты

Написать нам

-

+

Нажимая на кнопку «Отправить», Вы соглашаетесь на обработку персональных данных в
+соответствии с «Политикой конфиденциальности»

На главную