2021-11-21 13:14:07 +03:00
|
|
|
<?php
|
2024-08-17 11:40:38 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// Включить отображение всех типов ошибок
|
|
|
|
|
//ini_set('display_errors', 1);
|
|
|
|
|
//ini_set('display_startup_errors', 1);
|
|
|
|
|
//error_reporting(E_ALL);
|
|
|
|
|
|
2021-11-21 13:14:07 +03:00
|
|
|
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>
|
|
|
|
|
|
2025-09-03 00:00:47 +03:00
|
|
|
<?$curr_number = number_info(get_the_title(), $post_id);?>
|
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;
|
|
|
|
|
|
2024-08-17 11:40:38 +03:00
|
|
|
if ( !empty($posts) ) {
|
|
|
|
|
|
|
|
|
|
foreach ($posts as $post){
|
2021-12-18 01:25:19 +03:00
|
|
|
|
2024-08-17 11:40:38 +03:00
|
|
|
$posttags = get_the_tags($post->ID);
|
2021-12-18 01:25:19 +03:00
|
|
|
|
2024-08-17 11:40:38 +03:00
|
|
|
foreach ($posttags as $tag){
|
|
|
|
|
$pfind = strpos($tag->name, 'полоса');
|
|
|
|
|
|
|
|
|
|
if ($pfind !== false) {
|
|
|
|
|
|
|
|
|
|
$number = (int)substr($tag->name, 0, $pfind);
|
|
|
|
|
|
|
|
|
|
if ($number > $endpolosa ){
|
|
|
|
|
$endpolosa = $number;
|
|
|
|
|
}
|
|
|
|
|
$pitems[$number][] = $post;
|
2021-12-18 01:25:19 +03:00
|
|
|
}
|
|
|
|
|
}
|
2024-08-17 11:40:38 +03:00
|
|
|
|
2021-12-18 01:25:19 +03:00
|
|
|
}
|
2024-08-17 11:40:38 +03:00
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<?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);?>
|
2021-12-24 18:40:40 +03:00
|
|
|
|
2024-08-17 11:40:38 +03:00
|
|
|
<div class="main-card">
|
|
|
|
|
<?if ( has_post_thumbnail($item->ID) ) :?>
|
|
|
|
|
<div class="polosa-img">
|
|
|
|
|
<a href="<?the_permalink($item->ID);?>"><img src="<?php echo get_the_post_thumbnail_url($item->ID, 'large'); ?>" alt="<?=$item->title;?>"></a>
|
|
|
|
|
</div>
|
|
|
|
|
<?endif?><br>
|
|
|
|
|
<div class="main-card-title"><p><a href="<?the_permalink($item->ID);?>"><?=get_the_title($item->ID);?></a></p></div>
|
|
|
|
|
<div class="main-card-body">
|
|
|
|
|
<div><a href="<?the_permalink($item->ID);?>"><?=$item->post_excerpt?></a></div><br>
|
|
|
|
|
<div class="news_date"><a href="<?=$category_link?>"><?=$category['0']->name?></a></div>
|
2021-12-18 01:25:19 +03:00
|
|
|
</div>
|
2024-08-17 11:40:38 +03:00
|
|
|
</div>
|
|
|
|
|
<?endforeach?>
|
|
|
|
|
<?endif?>
|
|
|
|
|
<?}
|
|
|
|
|
}?>
|
2021-12-18 01:25:19 +03:00
|
|
|
|
|
|
|
|
|
2021-11-21 13:14:07 +03:00
|
|
|
|
2021-12-05 18:53:27 +03:00
|
|
|
<?php
|
2022-08-16 10:37:55 +03:00
|
|
|
$numbers_year = date('Y');
|
2021-12-05 18:53:27 +03:00
|
|
|
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();?>
|