correct data
This commit is contained in:
24
single.php
24
single.php
@@ -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';?>
|
||||
|
||||
Reference in New Issue
Block a user