correct parts in single-en
This commit is contained in:
@@ -26,7 +26,14 @@ array_push($categories, $firstElement);
|
||||
<?php elseif (is_category()) : ?>
|
||||
<span><?= $current_term->name; ?></span>
|
||||
<?php elseif (is_single()) :?>
|
||||
<span><?= get_cat_name($current_term_ids[0]); ?></span>
|
||||
<span><?
|
||||
$cat1 = get_cat_name($current_term_ids[0]);
|
||||
if ( $cat1 !== 'en') {
|
||||
echo $cat1;
|
||||
} else {
|
||||
echo get_cat_name($current_term_ids[1]);
|
||||
}
|
||||
?></span>
|
||||
<?php else : ?>
|
||||
<span>Parts</span>
|
||||
<?php endif; ?>
|
||||
|
||||
5
frontend/dist/assets/main.css
vendored
5
frontend/dist/assets/main.css
vendored
@@ -2588,6 +2588,11 @@ h3,
|
||||
.rating {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.lang-switch{
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.menu-item a {
|
||||
|
||||
@@ -38,6 +38,11 @@
|
||||
.rating {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.lang-switch{
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.menu-item a {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<?php get_template_part('single-events'); ?>
|
||||
<? else : ?>
|
||||
<div class="content-middle articles-wrapper">
|
||||
<?php get_template_part('partials/rubrics-mobile'); ?>
|
||||
<?php get_template_part('en/rubrics-mobile-en'); ?>
|
||||
|
||||
<div class="article-single">
|
||||
<div class="article-time article-single__time">
|
||||
@@ -14,7 +14,7 @@
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<?php if (!in_category('partners')) : ?>
|
||||
<div class="article-single__tag"><?=get_category_name(); ?></div>
|
||||
<div class="article-single__tag"><?=get_category_name_en(); ?></div>
|
||||
<? endif; ?>
|
||||
<h1 class="article-single__title">
|
||||
<?php the_title(); ?>
|
||||
|
||||
Reference in New Issue
Block a user