2021-11-21 13:14:07 +03:00
|
|
|
<?php
|
|
|
|
|
require TEMPLATEPATH.'/helpers/number_title.php';
|
|
|
|
|
|
|
|
|
|
get_header();?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="content">
|
|
|
|
|
|
|
|
|
|
<?//while(have_posts()):?>
|
|
|
|
|
<?the_post();?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php $category = get_the_category();
|
|
|
|
|
$category_id = $category[0]->term_id;
|
|
|
|
|
$category_link = get_category_link($category_id);
|
|
|
|
|
$post_id = get_the_ID();
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<ul id="nav_content">
|
|
|
|
|
<li><a href="<?=get_site_url()?>">Главная</li>
|
|
|
|
|
<li>-<li>
|
|
|
|
|
<li><a href="<?=$category_link?>"><?=$category['0']->name;?></a></li>
|
|
|
|
|
<li>-<li>
|
|
|
|
|
<li><?=mb_substr(get_the_title(), 0, 50);?>...</li>
|
|
|
|
|
</ul>
|
|
|
|
|
|
2021-11-21 22:00:02 +03:00
|
|
|
<?$curr_number = number_info(get_the_title())?>
|
2021-11-21 13:14:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
<h1 class="post-h1">Федеральное отраслевое издание «Ветеринария и жизнь»</h1>
|
|
|
|
|
|
|
|
|
|
<div class="current-number">
|
|
|
|
|
<?if ( has_post_thumbnail() ) :?>
|
|
|
|
|
<div class="number-img">
|
|
|
|
|
<img class="img-fluid rounded" src="<?php echo get_the_post_thumbnail_url(null, 'full');?>" alt="<?the_title();?>">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="number_title">
|
|
|
|
|
<div class="number_number"><?the_title()?></div>
|
2021-11-21 22:00:02 +03:00
|
|
|
<?if (isset($curr_number['guid'])):?>
|
2021-11-21 13:14:07 +03:00
|
|
|
<div>
|
2021-11-21 22:00:02 +03:00
|
|
|
<a href="<?=$curr_number['guid']?>" class="orange_button" target="_blank">Читать PDF версию</a>
|
2021-11-21 13:14:07 +03:00
|
|
|
</div>
|
|
|
|
|
<?endif?>
|
|
|
|
|
</div>
|
|
|
|
|
<?endif?>
|
|
|
|
|
</div>
|
2021-12-18 01:25:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<?$posts = get_posts([
|
2021-12-24 17:17:53 +03:00
|
|
|
|
|
|
|
|
'tag' => 'номер'.$curr_number['number'],
|
|
|
|
|
'post_type' => 'post',
|
|
|
|
|
'numberposts' => -1
|
2021-12-18 01:25:19 +03:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$pitems = [];
|
|
|
|
|
$endpolosa = 1;
|
|
|
|
|
|
|
|
|
|
foreach ($posts as $post){
|
|
|
|
|
|
|
|
|
|
$posttags = get_the_tags($post->ID);
|
|
|
|
|
|
|
|
|
|
foreach ($posttags as $tag){
|
|
|
|
|
$pfind = strpos($tag->name, 'полоса');
|
|
|
|
|
if ($pfind !== false) {
|
|
|
|
|
$number = substr($tag->name, 0, $pfind);
|
|
|
|
|
if ($number > $endpolosa ){
|
|
|
|
|
$endpolosa = $number;
|
|
|
|
|
}
|
|
|
|
|
$pitems[$number][] = $post;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}?>
|
|
|
|
|
|
|
|
|
|
<?for ($i = 1; $i <= $endpolosa; $i++) {?>
|
|
|
|
|
<?if (isset($pitems[$i])):?>
|
|
|
|
|
<h2 class="part_title">Полоса <?=$i?></h2>
|
|
|
|
|
<?foreach($pitems[$i] as $item):?>
|
|
|
|
|
<?$category = get_the_category($item->ID);
|
|
|
|
|
$category_id = $category[0]->term_id;
|
|
|
|
|
$category_link = get_category_link($category_id);?>
|
|
|
|
|
<div class="main-card">
|
|
|
|
|
<?if ( has_post_thumbnail($item->ID) ) :?>
|
|
|
|
|
<div class="card-img-top">
|
2021-12-18 01:45:58 +03:00
|
|
|
<a href="<?the_permalink($item->ID);?>"><img src="<?php echo get_the_post_thumbnail_url($item->ID, 'large'); ?>" alt="<?=$item->title;?>"></a>
|
2021-12-18 01:25:19 +03:00
|
|
|
<?if( has_tag( 'видео' ) ):?>
|
|
|
|
|
<span class="play-card"></span>
|
|
|
|
|
<?endif?>
|
|
|
|
|
</div>
|
|
|
|
|
<?endif?>
|
|
|
|
|
<div class="main-card-title"><a href="<?the_permalink($item->ID);?>"><?=get_the_title($item->ID);?></a></div>
|
|
|
|
|
<div class="main-card-body">
|
|
|
|
|
<div class="main-card-text"><a href="<?the_permalink($item->ID);?>"><?=$item->post_excerpt?></a></div>
|
|
|
|
|
<div class="news_date"><a href="<?=$category_link?>"><?=$category['0']->name?></a></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<?endforeach?>
|
|
|
|
|
<?endif?>
|
|
|
|
|
<?}?>
|
|
|
|
|
|
|
|
|
|
|
2021-11-21 13:14:07 +03:00
|
|
|
|
2021-12-05 18:53:27 +03:00
|
|
|
<?php
|
|
|
|
|
$numbers_year = 2021;
|
|
|
|
|
include get_template_directory().'/blocks/arh_more.php';
|
|
|
|
|
?>
|
2021-11-21 13:14:07 +03:00
|
|
|
|
|
|
|
|
<div class="publ-to-main">
|
2021-12-05 18:53:27 +03:00
|
|
|
<button class="more_button" onclick="location.href='<?=get_site_url()?>/category/arkhiv'" type="button">
|
|
|
|
|
Архив номеров</button>
|
2021-11-21 13:14:07 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php get_footer();?>
|