correct parts in single-en

This commit is contained in:
argoexpert press
2024-05-26 11:50:52 +03:00
parent 1e64fd0032
commit 2ecc4e4089
5 changed files with 32 additions and 3 deletions

View File

@@ -538,6 +538,18 @@ function get_category_name($post = null)
return $category_name;
}
function get_category_name_en($post = null)
{
$categories = get_the_category($post);
$categories = array_filter($categories, function (WP_Term $category) {
return $category->slug !== 'en';
});
$categories = array_values($categories);
$category_name = !empty($categories) ? esc_html($categories[0]->name) : 'Все события';
return $category_name;
}
// Добавляем функцию для формирования мета-тегов страницы
function custom_meta_tags() {