diff --git a/frontend/src/styles/components/tag.css b/frontend/src/styles/components/tag.css
index 77508e5..cf72b6f 100644
--- a/frontend/src/styles/components/tag.css
+++ b/frontend/src/styles/components/tag.css
@@ -3,6 +3,8 @@
line-height: 1.6rem;
padding: 0.1rem 1.2rem;
border: 1px solid var(--white);
- color: var(--white);
+ background-color: #fff;
+ color: black;
border-radius: 5rem;
+ opacity: 8;
}
diff --git a/functions.php b/functions.php
index f95c84d..7adec7a 100644
--- a/functions.php
+++ b/functions.php
@@ -533,7 +533,15 @@ function custom_meta_tags() {
$post = get_post(); // Получаем объект текущего поста или страницы
$title = get_the_title($post).' - '.$sitename; // Получаем заголовок текущего поста или страницы
- $description = get_the_excerpt($post); // Получаем отрывок текущего поста или страницы
+ $excerpt = get_the_excerpt($post);
+
+ if (has_excerpt()) {
+ $description = $excerpt;
+ } elseif (strlen($excerpt) > 300) {
+ $description = wp_trim_words($excerpt, 30, '...');
+ } else {
+ $description = $excerpt;
+ }
$tags = get_the_tags($post); // Получаем теги текущего поста или страницы
$keywords = ''; // Переменная для хранения ключевых слов
@@ -578,6 +586,7 @@ function custom_meta_tags() {
$og_tags .= ''. PHP_EOL;
}
if (!empty($description)) {
+ $description = wp_strip_all_tags($description);
$meta_tags .= ''. PHP_EOL;
$og_tags .= ''. PHP_EOL;
}