correct data

This commit is contained in:
2026-02-07 11:05:31 +03:00
parent 6ab9106be0
commit 09ef3e1d6d
12 changed files with 378 additions and 278 deletions

View File

@@ -47,6 +47,7 @@ if ( $pets_cat ){
if ( $pets_cat ):?>
<?echo "<!-- pets: $category_name-->"?>
<ul id="nav_content">
<li><a href="<?=get_site_url()?>/category/pets">Питомцы</li>
@@ -55,6 +56,22 @@ if ( $pets_cat ){
<li>-<li>
<li><?=mb_substr(get_the_title(), 0, 50);?>...</li>
</ul>
<?$categories = get_the_category();
if (count($categories) > 1 ){
if (!empty($categories)){
$category_links = '';
foreach ($categories as $cat) {
if ($cat->name == 'Новости' or $cat->name == 'События'){
continue;
}
if ($category_links !== ''){
$category_links .= ', ';
}
$category_item = get_category_link($cat->term_id);
$category_links .= '<a href="' . $category_item . '">' . $cat->name . '</a>';
}
}
}?>
<?else:
$category = get_the_category();
$category_id = $category[0]->term_id;
@@ -73,7 +90,12 @@ if ( $pets_cat ){
<div class="post_info">
<div class="post_info_sub">
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category_name;?></a></span>, <nobr><?php the_time('j F Y, G:i');?></nobr>
<?if (isset( $category_links )):?>
<span class="post_link_category"><?php echo $category_links; ?></span>
<?else:?>
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category_name;?></a></span>
<?endif?>
, <nobr><?php the_time('j F Y, G:i');?></nobr>
</div>
<div class="post_info_sub post_info_social">
<?php include get_template_directory().'/blocks/social-share.php';?>